diff options
-rw-r--r-- | client/player/follow_camera.gd | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/client/player/follow_camera.gd b/client/player/follow_camera.gd index ec260ee5..41f99d97 100644 --- a/client/player/follow_camera.gd +++ b/client/player/follow_camera.gd @@ -58,9 +58,12 @@ func _process(delta): func _input(_event): if disable_input: return if Input.is_action_just_pressed("reset"): - angle_target = 0 - angle_up_target = 1 - camera_distance_target = 10 + reset() + +func reset(): + angle_target = 0 + angle_up_target = 1 + camera_distance_target = 10 func follow(delta): if not disable_input: angle_target += Input.get_axis("rotate_left", "rotate_right") * ( @@ -105,4 +108,9 @@ func follow(delta): func set_ingame(state: bool, in_lobby: bool): # Disable input in lobby - disable_input = state and in_lobby + if state and in_lobby: + reset() + disable_input = true + else: + disable_input = false + |