Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

"This mouse is no longer active" how do I fix this?

Asked by 5 years ago

I am sometimes getting this error 22:03:57.337 - This Mouse is no longer active It doesn't pop up a lot, but when it does it stops my gun from shooting. This is the line of code that it's coming from, the "mouse.hit.p"

local ray = Ray.new(hole.CFrame.p, (mouse.hit.p - hole.CFrame.p) * range.Value)

Is there a way to fix this, or should I use something else in place of this if so, what?

0
Could you please add more to this code? Just this doesn't tell us much. Just2Terrify 566 — 5y
0
From what I've been able to gather about this problem is to just put an error handler around it, basically a pcall. CeramicTile 847 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

That means that the mouse is no longer defined, so you should redefine it before the code.

local mouse = game.Players.LocalPlayer:GetMouse()
local ray = Ray.new(hole.CFrame.p, (mouse.hit.p - hole.CFrame.p) * range.Value)
0
Thanks, the error hasn't been showing up anymore. zandefear4 90 — 5y
Ad

Answer this question