Walking moves forward taking rotation into account
parent
c8e0300a2b
commit
d923fc700c
|
@ -35,7 +35,7 @@ remote func jump():
|
||||||
velocity.y = JUMP_VELOCITY
|
velocity.y = JUMP_VELOCITY
|
||||||
|
|
||||||
func motion(delta):
|
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):
|
func _physics_process(delta):
|
||||||
gravity()
|
gravity()
|
||||||
|
|
Reference in New Issue