# Camera rolls instead of looking up and down

I got a small script from the official Unity forum which is:

public class MouseRotationUpDown : MonoBehaviour {
public float RotationSpeed = 5;

void Update ()
{
transform.Rotate(Input.GetAxis("Mouse Y") * RotationSpeed,0, 0 /** Time.deltaTime*/, Space.World);
}
}


This script should rotate (as in looking up and down) the camera, based on my mouse movement. But instead of just rotating the camera over the X axis (up & down) it rotates the camera over all three axis at once.

This is the only script attached right now.

• You're rotating with respect to Space.World. So if your camera's z-axis is pointing along the world x-axis, then what you're applying as a pitch (world x-axist rotation) will be observed as a roll (local z-axis rotation). Does the problem persist if you try Space.Self, or play with different starting orientations for the camera? – DMGregory Jun 22 '15 at 19:55
• @DMGregory You fixed the issue. I think I should've gone more in depth when reading up on rotation. Didn't know the details about the 4th parameter in the function. – Giani Noyez Jun 22 '15 at 19:59