How to fix the cursor in the game area. First person camera control

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By hello007

My game has first person controls. Character rotation happens when I move the mouse, just like in any other game with the same camera view. When the cursor touches the border of the screen, I can’t move the camera any further.

How can I hide the cursor, but so that it continues to send signals and does not go off the screen?

I tried to make it so that the cursor would be fixed to a certain area of ​​the screen, but in this case, I could not move the camera. She constantly twitched in one place when trying to turn the character.

Input.warp_mouse_position(Vector2(num1, num2)) does not work. camera twitches

:bust_in_silhouette: Reply From: Ninfur

You are probably looking for

Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)