Advertisement
chris33556

alternative movement script method

Dec 1st, 2022
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. velocity = Vector2.ZERO
  2. if Input.is_action_pressed("RIGHT"):
  3. velocity.x += 1
  4. if Input.is_action_pressed("LEFT"):
  5. velocity.x -= 1
  6. if Input.is_action_pressed("DOWN"):
  7. velocity.y += 1
  8. if Input.is_action_pressed("UP"):
  9. velocity.y -= 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement