title: Unity camera spinning around uncontrollably
body: <p>I'm trying to clamp the camera rotation but when doing so the camera spins out uncontrollably. I tried it with <code>Math.fClamp</code> and another way and both seem to do the exact same thing.</p>
  
  <p>Here is the code that I use:</p>
  
  <pre><code>public class CameraController : MonoBehaviour 
  {
      float mRotY;
  
      private void Start () 
      {
          if (rigidbody) rigidbody.freezeRotation = true;
          Screen.lockCursor = !Debug.isDebugBuild;
      }
      private void FixedUpdate () 
      {  
          mRotY = Input.GetAxis ("Mouse Y") * GameManager.sensitivity * Time.deltaTime;
  
          if (mRotY &gt; 270.0f) mRotY = 270.0f;
          else if (mRotY &lt; 90.0f) mRotY = 90.0f; 
  
          transform.Rotate(mRotY, 0.0f,0.0f);
      }
  }
  </code></pre>