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?

2 comments
Could you please add more to this code? Just this doesn't tell us much.
From what I've been able to gather about this problem is to just put an error handler around it, basically a pcall.