fixed diagonal

This commit is contained in:
SarDinah 2022-04-05 21:05:59 -07:00
parent 5f0208ab7a
commit d5ce5f9d65
1 changed files with 2 additions and 0 deletions

View File

@ -25,6 +25,8 @@ func _physics_process(delta):
direction.y -= 1
if Input.is_action_pressed("down"):
direction.y += 1
if direction.y != 0 and direction.x !=0:
direction = Vector2.ZERO
print(direction.normalized()*speed)
direction = direction.normalized() * speed
move_and_collide(direction)