Advertisement
DugganSC

Untitled

Jun 11th, 2023
1,388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.76 KB | None | 0 0
  1. IEnumerator TurnAroundAndShoot()
  2.     {
  3.         _shootingBack = true;
  4.         bool sweepingRight = true;
  5.  
  6.         Debug.Log("Entering turn around");
  7.         // Turn until reversed
  8.         while (_turret.transform.eulerAngles.z < 180f && transform.position.y > GameManager.dBound)
  9.         {
  10.             _turret.transform.Rotate(Vector3.forward * Time.deltaTime * _rotationSpeed);
  11.             Debug.Log($"Rotation: {_turret.transform.eulerAngles.z}");
  12.  
  13.            
  14.  
  15.             yield return new WaitForSeconds(0.1f);
  16.         }
  17.  
  18.         Debug.Log("Exiting");
  19.        
  20.         // Rotate back
  21.         this.transform.rotation = Quaternion.identity;
  22.         Debug.Log(transform.rotation.eulerAngles);
  23.         _shootingBack = false;
  24.  
  25.         yield break;
  26.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement