summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client/player/controllable_player.gd11
1 files changed, 9 insertions, 2 deletions
diff --git a/client/player/controllable_player.gd b/client/player/controllable_player.gd
index c88941d7..131bc55d 100644
--- a/client/player/controllable_player.gd
+++ b/client/player/controllable_player.gd
@@ -60,13 +60,20 @@ func _process(delta):
update_touch_scrolls()
var moving_duration = 0
+var fps_rotation_target = 0
func _process_movement(delta):
var input = Input.get_vector("left", "right", "forwards", "backwards") if is_input_enabled() else Vector2.ZERO
if Global.get_setting("gameplay.first_person"):
- input.x *= 0.1
+ fps_rotation_target += input.x * delta * 3.
+ if abs(input.x) > 0.1: input.y -= 0.5
+ input.x = 0.
input.y = min(input.y, 0)
+ input = input.rotated(fps_rotation_target)
+ else:
+ input = input.rotated(input_rotation)
+
var boost = Input.is_action_pressed("boost") or (Global.get_setting("gameplay.latch_boost") and boosting)
- input = input.rotated(input_rotation)
+ #
if Input.is_action_pressed("interact") or Input.is_action_just_released("interact"):
input *= 0
else: