Check velocity length without y axis

pull/8/head
Tetane 2023-09-18 19:49:53 +07:00
parent f9731dff46
commit 34e0c028fb
1 changed files with 1 additions and 1 deletions

@ -48,7 +48,7 @@ func _physics_process(delta):
# Rotation
if velocity.length() > 0:
if Vector2(velocity.z, velocity.x).length() > 0:
rotation_direction = Vector2(velocity.z, velocity.x).angle()
rotation.y = lerp_angle(rotation.y, rotation_direction, delta * 10)