title: unity rotate object on x-axis when moving mouse up / down
body: <p>I want to rotate a object on the x-axis when I move the mouse up or down (increase the x-rotation when moving mouse up, decrease when moving mouse down).</p>
  
  <p>But I don't know how to do this.</p>
  
  <p>I tried this script: </p>
  
  <pre><code>public float mouseSensitivity = 100.0F;
  public float clampAngle = 80.0F;
  
  float rotX = 0.0F, rotY = 0.0F;
  
  void Update()
  {
      // Mouse Look
      float mouseX = Input.GetAxis("Mouse X");
      float mouseY = Input.GetAxis("Mouse Y");
  
      rotX += mouseY * mouseSensitivity * Time.deltaTime;
      rotY += mouseX * mouseSensitivity * Time.deltaTime;
  
      rotX = Mathf.Clamp(rotX, -clampAngle, clampAngle);
  
      Quaternion localRotation = Quaternion.Euler(rotX, 0, 0.0F);
      transform.rotation = localRotation;
  }
  </code></pre>
  
  <p>But this controls also rotation on the y axis. I also have rotation on the y-axis, but they are controlled via keyboard input:</p>
  
  <pre><code>if (Input.GetKey(KeyCode.W) &amp;&amp; !Input.GetKey(KeyCode.S))
      transform.Translate(Vector3.forward * Time.deltaTime * moveSpeed);
  else if (Input.GetKey(KeyCode.S) &amp;&amp; !Input.GetKey(KeyCode.W))
      transform.Translate(Vector3.forward * Time.deltaTime * -moveSpeed);
  
  if (Input.GetKey(KeyCode.A) &amp;&amp; !Input.GetKey(KeyCode.D))
      transform.Rotate(Vector3.up * Time.deltaTime * -rotateSpeed, Space.World);
  else if (Input.GetKey(KeyCode.D) &amp;&amp; !Input.GetKey(KeyCode.A))
      transform.Rotate(Vector3.up * Time.deltaTime * rotateSpeed, Space.World);
  </code></pre>
  
  <p>and I want the mouse up/down only control the rotation on the x-axis.</p>
  
  <p>If someone can help me, that would be great!</p>