title: transform.Rotate an empty game object in unity
body: <p>I am trying to make an empty game object which is the path generator rotate when placing a tile left or right.</p>
  <p>But somehow it does not rotate the object.</p>
  <p>Plz help!</p>
  <pre><code>using System.Collections;
  using System.Collections.Generic;
  using UnityEngine;
  
  public class PathGenerator : MonoBehaviour
  {
      #region Settings
  
      //Settings to customize this script
  
      float gapSize = 0.4f; //0,4 coord gaps between squares
  
      #endregion
  
      public GameObject ChosenPath;
      public GameObject NonChosenPath;
  
      private Vector3 InitPos;
      private Vector3 NextPos;
  
      public Vector3 angleRotation;
  
      public string pathDirection;
  
      // Start is called before the first frame update
      void Start()
      {
         InitPos = new Vector2(gapSize,gapSize);
         NextPos = InitPos;
      }
  
      // Update is called once per frame
      void Update()
      {
          if(Input.GetKey(KeyCode.Space))
          {
              ChangePath();
          }
      }
  
      void ChangePath()
      {
          double randomNumQ = Random.Range(0,3);
          if(randomNumQ == 0)
          {
              pathDirection = &quot;Forward&quot;;
              NextPos.y += gapSize;
          }
          else if(randomNumQ == 1)
          {
              pathDirection = &quot;Left&quot;;
              NextPos.x += gapSize;
              angleRotation.z = -90; 
              transform.Rotate(angleRotation);
          }
          else if(randomNumQ == 2)
          {
              pathDirection = &quot;Right&quot;;
              NextPos.x -= gapSize;
              angleRotation.z = 90; 
              transform.Rotate(angleRotation);
          }
          Instantiate(ChosenPath, NextPos, transform.rotation = Quaternion.identity);
          transform.position = NextPos;
      }
  }
  </code></pre>