#Move Player 4-directions
3 messages · Page 1 of 1 (latest)
You won't want to use get_vector for this. You'll need to decide which axis to prioritize, x or y, and then handle them separately
Something like this :
var direction: Vector2 = Vector2.ZERO
if Input.is_action_pressed("move_left"): direction = Vector2.LEFT
elif Input.is_action_pressed("move_right"): direction = Vector2.RIGHT
elif Input.is_action_pressed("move_up"): direction = Vector2.UP
elif Input.is_action_pressed("move_down"): direction = Vector2.DOWN
velocity = direction * speed```