- Home /
This question was
closed May 14, 2020 at 12:39 AM by
_-puppytails-_ for the following reason:
Other
Question by
_-puppytails-_ · May 13, 2020 at 01:18 AM ·
mathf.clamp
Camera not clamping
I have some code that I believe should have the camera clamp, however, it doesn't I've tried for a while now with no avail. What is at fault? Thank you in advance
rotateX += Input.GetAxis("Mouse X") * s.YSens * Time.deltaTime;
rotateY += -Input.GetAxis("Mouse Y") * s.XSens * Time.deltaTime;
rotateY = Mathf.Clamp(rotateY, -90, 90);
Quaternion qq = new Quaternion();
qq = Quaternion.AngleAxis(rotateY, Vector3.right);
Camera.transform.localRotation = Camera.transform.localRotation * qq;
Comment