fixed diagonal
This commit is contained in:
parent
5f0208ab7a
commit
d5ce5f9d65
1 changed files with 2 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue