Joey Eamigh 9989fab018
addons?
2025-10-10 14:07:23 -04:00

9 lines
340 B
GDScript

extends Control
## Control node that captures the mouse for games that require it.
##
## Used for games that use the mouse to move the camera (ex. FPS or third-person shooters).
func _gui_input(event):
if event is InputEventMouseButton and Input.mouse_mode != Input.MOUSE_MODE_CAPTURED:
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)