This is the code-snippet that has issues:
float sensitivity = 3.0; float looker = -Input.GetAxis("Mouse Y") * sensitivity; if (looker != 0) { var clampedX = Mathf.Clamp(cam.transform.eulerAngles.x + looker,-89,70); cam.transform.eulerAngles = new Vector3(clampedX, cam.transform.eulerAngles.y, 0); }
While the variable cam is a Camera
So the issue here is that if i now move the camera down with this script it’s working normaly, but when I try to look up, the Mathf.Clamp does sh*t, and moves the camera back to x=70.
Can you tell me what I did wrong here?
Thanks in advance!