How to lock cursor in place without capturing?

Godot Version

4.6.1.stable

Question

I am making a camera system similar to Roblox’s, where the player holds right click to rotate the camera around. I need the cursor to stay in the same place but I can’t seem to find out how. When I use warp_camera(), the camera gets twitchy and snaps back to the locket position. How can I lock the cursor without changing the mode to capture?

Capture mode may actually be what you want, but to warp the mouse back to it’s previous position. This thread has a good solution, though on windows you may need to use warp_mouse.call_deferred or waiting a frame

2 Likes

I am doing the same thing at the moment, but it creates issues as I also use mouse position to check if user is hovering over a part (it gets highlighted if hovered on). If I could figure out a way to prevent warp_camera() from triggering InputEvent, I could fix my current system.

As a temporary fix though, I think I will make a custom cursor which follows the actual (hidden) cursor, and freezes when camera is being rotated.