Strange mouse position delay?

I am not sure if this is an engine bug or not (I don’t really think it is) but where the gun shoots is delaying from where the mouse actually is. This makes it extremely hard to hit shots.

I have no idea what it could be?
Here is a video of it happening:
https://streamable.com/g9nipw

Please ask me if you want code. I have to much scripts too put here.
I have a script that handles raycasts and effects and a script that handles inputs. Also a localscript that makes recoil and sends the remove event to the script that handles inputs.

1 Like

Question is whether the firing is instantaneous or not. If it is instantaneous on click, then I don’t know. Otherwise it must be some sort of client-server delay.

1 Like

Not any yielding or waiting between the firing of the event. But there are if statements which shouldn’t do much. If its just client-server delay could I fix it some how?

Here’s an idea. The client will keep sending their mouse position every time they try to fire somewhere. This will keep it more consistent. It will not change the raycasting though, it only changes the ending point of the raycast, which is a variable in this case.

1 Like

So every time they are firing it should send its position in a loop?

Mmm, no. Not exactly. I meant like if they click, the position of the mouse it was previously clicking at will be updated on the server, if I assume that you’re running a remote event on this, when the firearm is “busy” and not able to fire another round.

1 Like

Sorry for the late response. But thanks Ill try it.