Advertisement
Guest User

Untitled

a guest
Sep 20th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. if(player.transform.position.x== 0)
  2. {
  3. if (Input.GetKeyDown(KeyCode.A))
  4. {
  5. player.transform.Translate(-1,0,0);
  6. }
  7. if (Input.GetKeyDown(KeyCode.D))
  8. {
  9. player.transform.Translate(+1,0,0);
  10. }
  11. }
  12.  
  13.  
  14. if (player.transform.position.x == -1)
  15. {
  16. if (Input.GetKeyDown(KeyCode.A))
  17. {
  18. }
  19. if (Input.GetKeyDown(KeyCode.D))
  20. {
  21. player.transform.Translate(+1, 0, 0);
  22. }
  23.  
  24. }
  25.  
  26.  
  27. if (player.transform.position.x == +1)
  28. {
  29. if (Input.GetKeyDown(KeyCode.A))
  30. {
  31. player.transform.Translate(-1, 0, 0);
  32. }
  33. if (Input.GetKeyDown(KeyCode.D))
  34. {
  35. }
  36.  
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement