From b1d9bfe7e80b4d95acd26d0ab6a1ce34ad18d91c Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Sun, 24 Nov 2024 11:46:03 +0100 Subject: next commit --- free-look-camera.gd | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'free-look-camera.gd') diff --git a/free-look-camera.gd b/free-look-camera.gd index e35485f..50c2311 100644 --- a/free-look-camera.gd +++ b/free-look-camera.gd @@ -30,6 +30,14 @@ var _shift = false var _alt = false func _input(event): + if not current: + return + + if event is InputEventMouse and event.is_pressed(): + Input.mouse_mode = Input.MOUSE_MODE_CAPTURED + if event.is_action_pressed("mouse_exit"): + Input.mouse_mode = Input.MOUSE_MODE_VISIBLE + # Receives mouse motion if event is InputEventMouseMotion: _mouse_position = event.relative @@ -66,6 +74,9 @@ func _input(event): # Updates mouselook and movement every frame func _process(delta): + if not current: + return + _update_mouselook() _update_movement(delta) -- cgit v1.2.3