From c3e906f33c4b90d08299a940b53a95b435eefc32 Mon Sep 17 00:00:00 2001 From: teatov Date: Sat, 15 Feb 2025 00:35:10 +1000 Subject: [PATCH] add extra check for controlling player --- scripts/player.gd | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/player.gd b/scripts/player.gd index afbac42..92db643 100644 --- a/scripts/player.gd +++ b/scripts/player.gd @@ -88,7 +88,10 @@ func _unhandled_input(event: InputEvent) -> void: if not is_multiplayer_authority(): return - if not Inputer.can_control_player(): + if ( + not Inputer.can_control_player() + or Input.mouse_mode != Input.MOUSE_MODE_CAPTURED + ): return if event is InputEventMouseMotion: @@ -167,9 +170,7 @@ func _lateral_movement(delta: float) -> void: var input_dir := Input.get_vector( "move_left", "move_right", "move_forward", "move_back" ) - var has_input := ( - input_dir.length() > 0 and Inputer.can_control_player() - ) + var has_input := input_dir.length() > 0 and Inputer.can_control_player() if has_input: var direction := (