Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. void Update () {
  2. if (Input.GetKeyDown(KeyCode.A))
  3. {Vector3 position = this.transform.position;
  4. position.x--;
  5. this.transform.position = position;
  6.  
  7. }
  8. if (Input.GetKeyDown(KeyCode.D))
  9. {
  10. Vector3 position = this.transform.position;
  11. position.x--;
  12. this.transform.position = position;
  13.  
  14. }
  15. if (Input.GetKeyDown(KeyCode.W))
  16. {
  17. Vector3 position = this.transform.position;
  18. position.y++;
  19. this.transform.position = position;
  20.  
  21. }
  22. if (Input.GetKeyDown(KeyCode.S))
  23. {
  24. Vector3 position = this.transform.position;
  25. position.y++;
  26. this.transform.position = position;
  27.  
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement