I have to rotate my camera 90 degrees and be able to look with mouse. I got it working with 180° angle, but not 90°.
http://dl.dropbox.com/u/70186988/Problem.html ← Unity webplayer
You can probably see what is problem if you try that demo.
Code:
RotationZ is 90° on those scripts. (Applied on another script)
Script1 (This is attached to camera):
function Update(){
Limiter(); //This is just for limiting angle, don't mind about this
rotationX = script2.rotationX;
rotationY += Input.GetAxis("Mouse Y") * sensitivity;
rotAngle = Quaternion.Euler(Vector3(rotationX,rotationY,rotationZ));
transform.rotation = rotAngle;
}
Script2 (This is attached to player model):
function Update(){
Limiter(); //Still just limiting.
rotationX += Input.GetAxis("Mouse X") * sensitivity;
rotAngle = Quaternion.Euler(Vector3(rotationX,90,rotationZ));
transform.rotation = rotAngle;
}
I can give you more information if u need. I have been thinking this problem for a while and can’t understand what is wrong.
EDIT:
Click attachments to see bigger picture. Playerrota = script2, you don’t probably need moving script information but it came with screenshots. Mouselook = script1.