Moving the mouse forward and back only tilts view

I am struggling too get rid of the tilt on the gimbaled camera.

If I change the -mouseY bit of the code to 0 on the last line of code, it does not tilt, but when I leave it in, it acts like a yaw in a plane banking.

What I am doing wrong as the code looks the same as the lesson?

There might be something up with the rotation and transform of the GameObjects in the scene. Have a look there too.

Should the Camera Rotation script be in the ( child ) main camera or the ( Parent ) Player?

No I tried the different options with parent and child holding the script, I am missing something and I just need to figure out what.

Got it.

I don’t know if it was because of how I set the scene up originally or if it is because I moved something when learning.

In the end I decided to do this part again and that was where the error was.


I went to file:- New scene and laid the floor cube down again.

I created the empty placeholder and called it Player.

After attaching the main camera to it as a child, I removed the camera script from the main camera and reapplied it to the Player parent.

I tested it and it worked.

Breakdown of problem and solution:-

Problem / Error
The tilt was happening when I was moving the mouse forward and back, and the code was fine.
Create a new scene and save it over the old main scene file.
The scripts ect are still there.


Privacy & Terms