title: Unity fps rotation camera
body: <p>In my game I have a camera and I want to have an FPS like rotation attached to this camera.</p>
  
  <p>So if I move my cursor to the left, I want my cam to rotate to the left. If I move my cursor up, then the cam should look up, etc.</p>
  
  <p>I currently have it partially working. I can look left and right, up, and down. The problem occurs when I look down and then move my cursor left and right. It then gives me a "Roll" effect.</p>
  
  <p>See this video to see exactly what I mean:
  <a href="http://www.screencast.com/t/Phedh8H0K13" rel="nofollow noreferrer">http://www.screencast.com/t/Phedh8H0K13</a></p>
  
  <p>Obviously when I look down I still want to have a "Yaw" effect instead of a "Roll" effect. Anyone any idea how to do that? This is what I have so far:</p>
  
  <pre class="lang-c# prettyprint-override"><code>// Update is called once per frame
  public override void update ()
  {
      this.camera.transform.rotation *= 
          Quaternion.AngleAxis( Time.deltaTime * sensitivityRoll * Input.GetAxis("Vertical"), Vector3.forward );
  
      this.camera.transform.rotation *= 
          Quaternion.AngleAxis( Time.deltaTime * sensitivityYaw * Input.GetAxis("Mouse X"), Vector3.up );
  
      this.camera.transform.rotation *= 
          Quaternion.AngleAxis( Time.deltaTime * sensitivityPitch * Input.GetAxis("Mouse Y"), Vector3.left );
  }
  </code></pre>