title: How do I get one of the coordinates of rotation in unity?
body: <p>I wanted to a cube do not rotate more than 60 degrees so it dosn't rotate to more
  I tried to use this</p>
  
  <pre><code>if(gameObject.GetComponent&lt;Transform&gt;().rotation.x &gt;= 60 || gameObject.GetComponent&lt;Transform&gt;().rotation.x &lt;= -60 || gameObject.GetComponent&lt;Transform&gt;().rotation.z &gt;= 60 || gameObject.GetComponent&lt;Transform&gt;().rotation.z &lt;= -60)
      {
          gameObject.GetComponent&lt;Transform&gt;().rotation = new Quaternion(0, 0, 0, 0);
      }
  </code></pre>
  
  <p>to check the rotation. 
  It didn't work so I print what rotation is getting in the x coordinate</p>
  
  <p>and it said cordinates like:
  5.98324, 7.39482, -1.983495</p>
  
  <p>and I was just moving the x position not the rotation and It change it.</p>
  
  <p>So how do I get the x rotation that it sais in the component transform?</p>