- Home /
controller
I am trying to constrain my mouse look to rotate only on the z axis. The mouse look script that comes with unity only has the choices to change the x and y axis. Can anyone expain how to do this or refer me to a reference page, a video tutorial or a script? thanx
What exactly do you wanna do? In the $$anonymous$$ouseLook script, the character rotates on the Y axis (horizontal plane), and the camera rotates on the X axis (vertical plane). If you rotate the camera on the Z axis, it will tilt to left or right. Is it what you're looking for?
Answer by Dreamer · Jun 13, 2011 at 09:13 AM
Just delete some thing like rotationY += Input.GetAxis("LookUp") * lookSpeed; in the script.
Answer by Ninjaoboy · Jun 13, 2011 at 01:45 PM
I think that you want the character to rotate sideways with the camera... like an fps game? if so then what you do is put the camera-control script on the camera an set it to only have an x speed for sensitivity,then go to your parent, player(the object that has your walking script) then put the camera rotate on that also, but this time make X = 0, and y = 5(or what ever you want for the turn speed.
i hope this is what your looking for and helps....
Your answer
![](https://koobas.hobune.stream/wayback/20220612103944im_/https://answers.unity.com/themes/thub/images/avi.jpg)