Walking moves forward taking rotation into account

remotes/1705382094874458415/tmp_refs/heads/godot4-port
unfa 2020-06-14 02:09:52 +02:00
parent c8e0300a2b
commit d923fc700c
1 changed files with 1 additions and 1 deletions

View File

@ -35,7 +35,7 @@ remote func jump():
velocity.y = JUMP_VELOCITY
func motion(delta):
self.move_and_slide(velocity * delta, Vector3.UP)
self.move_and_slide(velocity.rotated(Vector3.UP, self.rotation.y) * delta, Vector3.UP)
func _physics_process(delta):
gravity()