Hello, I’m self teaching myself Unity, and I can’t figure out why this code won’t work. I’m trying to limit the X Rotation of my Main Camera, so that it won’t do flips. Here’s the part of my code that matters.
function Look(){
LookVector = Vector2 ( Input.GetAxis ("Mouse X") , Input.GetAxis ("Mouse Y") );
}
function Movement(){
var camAngleX = Camera.main.transform.eulerAngles.x;
Camera.main.transform.Rotate( -LookVector.y * Time.deltaTime * Look_Sensitivity , 0 , 0);
Mathf.Clamp(camAngleX , -90 , 90);
Debug.Log (camAngleX);
}
What happens in-game, is that when I look around, I can still do flips. Thank you.