x


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

more ▼

asked Jun 13 '11 at 07:04 AM

DFiable gravatar image

DFiable
141 43 54 55

What exactly do you wanna do? In the MouseLook 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?

Jun 13 '11 at 01:33 PM aldonaletto
(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

Just delete some thing like rotationY += Input.GetAxis("LookUp") * lookSpeed; in the script.

more ▼

answered Jun 13 '11 at 09:13 AM

Dreamer gravatar image

Dreamer
1.5k 39 49 66

(comments are locked)
10|3000 characters needed characters left

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....

more ▼

answered Jun 13 '11 at 01:45 PM

Ninjaoboy gravatar image

Ninjaoboy
11 5 6 7

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2168
x984
x523
x27

asked: Jun 13 '11 at 07:04 AM

Seen: 757 times

Last Updated: Jul 16 '11 at 12:42 PM