Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private bool isTurned = false;
- void Update()
- {
- if (Input.GetKeyDown(KeyCode.A))
- {
- if (!isTurned)
- {
- transform.Rotate(0, 180, 0);
- isTurned = true;
- }
- }
- if (Input.GetKeyUp(KeyCode.A))
- {
- if (isTurned)
- {
- transform.Rotate(0, 180, 0);
- isTurned = false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment