Eonirr

Untitled

Jun 8th, 2025
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. private bool isTurned = false;
  2.  
  3. void Update()
  4. {
  5. if (Input.GetKeyDown(KeyCode.A))
  6. {
  7. if (!isTurned)
  8. {
  9. transform.Rotate(0, 180, 0);
  10. isTurned = true;
  11. }
  12. }
  13.  
  14. if (Input.GetKeyUp(KeyCode.A))
  15. {
  16. if (isTurned)
  17. {
  18. transform.Rotate(0, 180, 0);
  19. isTurned = false;
  20. }
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment