Y axis is inveted

Im trying to get the camera to move up and down. it works, but the y axis is inverted so when my mouse moves down, the camera moves up

code c#

float vertical = Input.GetAxis (“Mouse Y”) * rotateSpeed;
target.transform.Rotate (vertical, 0, 0);

	float desiredAngle = target.transform.eulerAngles.y;
	Quaternion rotation = Quaternion.Euler (desiredAngle, 0, 0);
	transform.position = target.transform.position - (rotation * offset);
	
	
	transform.LookAt (target.transform);

float vertical = Input.GetAxis (“Mouse Y”) * rotateSpeed;
target.transform.Rotate (-vertical, 0, 0);

Hope this may help you.
Nsks

So you’re saying when you move the mouse down, the camera goes up, but when you go move up the camera moves down? Or does it remain the same (as in both up and down cause the camera to move up)?

The way i’m currently thinking you could do is to add a ‘-’ negative operand (?) to the input, which will then make it negative. Failing that, why not do something like this to help you debug?

void OnGUI () {
    GUI.Box(new Rect(8, 8, 320, 32), "Mouse X: " + Input.GetAxis("Mouse X").ToString() + " | Mouse Y: " + Input.GetAxis("Mouse Y").ToString());
}

That way it’ll be updating in play mode, so when you move the mouse around you’ll be able to see what values Unity’s getting.

I hope that helps.