Hi! I’m making a camera in my FPS-game and I faced the problem that when I look down or up too much, the camera doesn’t stop at 90°, so I can look at 360°. How can I fix it? Here’s the script:
mouseInput = new Vector2(Input.GetAxisRaw("Mouse X"), Input.GetAxisRaw("Mouse Y")) * mouseSensitivity;
transform.rotation = Quaternion.Euler(transform.rotation.eulerAngles.x, transform.rotation.eulerAngles.y, transform.rotation.eulerAngles.z - mouseInput.x);
viewCam.transform.localRotation = Quaternion.Euler(viewCam.transform.localRotation.eulerAngles + new Vector3(0f, mouseInput.y, 0f));
“viewCam” is the “public Camera” object.
Thanks for any help!