Mouse Look Controller that can rotate on the Z axis

Heya all.

I’m looking for a code that will let me rotate my first person controller on the Z axis. I’m making a game where gravity changes and the character needs to be able to rotate to be on his feet again instead of hitting his head on the roof which has now become the floor.

I’ve already gotten the movement and jumping down, but the default mouse look script refuses to let me rotate on the Z axis no matter what. I looked at it’s code, it’s a bit complex for me. I get that it’s trying to keep me straight up. That’s fine, I like that part, I just want a way to disable that for a bit to flip the character and turn it back on after.

hey is this roughly what you want? change the block which reads:

 
    else if (axes == RotationAxes.MouseX){

            transform.Rotate(0, Input.GetAxis("Mouse X") * sensitivityX, 0);

        }

into

 
else if (axes == RotationAxes.MouseX){

            transform.Rotate(0, 0, Input.GetAxis("Mouse X") * sensitivityX);

        }

is that what you want?