Fix Mouse Position Lag

This is inherent to how the OS mouse cursor is drawn compared to any other window, and is not an issue exclusive to Godot. You can’t fix this entirely unless you replace the mouse cursor image with the sprite’s texture, which you can do using OS.set_custom_mouse_cursor(). The arrow will still appear to lag behind slightly though, which you could mitigate by making look_at() point towards the extrapolated (predicted) mouse cursor’s position instead of its current mouse position. Doing so will introduce some visible error when the mouse cursor speed changes quickly though, so the result may look shaky in motion.

If you can’t use hardware mouse cursors for some reason, see the suggestions to reduce Input lag in the documentation.

3 Likes