How to make seamless 3D mouse movement

Godot Version

4.6.3

Question

I’m making an FPS(3D, obviously), and I want the camera movement to - how do i say it? I’ll try and explain. Right now, whenever I move my cursor beyond the main game screen, I cant move the camera - which is a problem because it means that my camera cant properly do a 360 without moving the cursor out of the main game screen, and all the way to the other end of it. I want to know how I could loop the mouse movement(keep it contained inside the screen and move it to the other end of the screen if it tries to go out of bounds)in the screen.
If you could help, that would be amazing! Thanks

You can capture the mouse

Input.mouse_mode = Input.MOUSE_MODE_CAPTURED

Many will add such code to capture the mouse when clicked and release with escape

func _unhandled_input(event: InputEvent) -> void:
	if event is InputEventMouseButton:
		Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
	elif event is InputEventKey and event.keycode == KEY_ESCAPE:
		Input.mouse_mode = Input.MOUSE_MODE_VISIBLE

Thanks so much, mate, it’s fixed now.