Already a couple of hours I suffer with this tried with the help of Mathf.Clamp, but the turn was not limited to + this kind of addiction appeared. Help please, here's the code:
FixedUpdate() { float yRotGo = rotateY(); Vector3 yrot = new Vector3(0f, Mathf.Clamp(-yRotGo, -60, 60), 0f) * sensetive; } private static float rotateX() { return Input.GetAxisRaw("Mouse X"); } private static float rotateY() { return Input.GetAxisRaw("Mouse Y"); }
yrot
used? Because for this fragment I see that everything is correct. Offhand, I can only advise you to put theClamp
inside therotateY()
function, since you have created such a wrapper. - trollingchar