Hi!
I got a big problem. I want that you can look in x axes from 50 to -60.
If you look at a angle than is bigger than 50 it reset you to 50. Thats all right.
But if you want to go up to the -60 limit, you cant get to it. Unity resets you at 0 to 50.
So you cant get up over angle 0 to -60.
Anybody help?
if (cam.transform.rotation.eulerAngles.x < 50f && cam.transform.rotation.eulerAngles.x > -60f) {
cam.transform.Rotate(-Input.GetAxis("Mouse Y") * mouseSpeed * Time.deltaTime, 0, 0);
}
if (cam.transform.rotation.eulerAngles.x > 50) {
cam.transform.localRotation = Quaternion.Euler(50, 0, 0);
}
if (cam.transform.rotation.eulerAngles.x < -60) {
cam.transform.localRotation = Quaternion.Euler(-60, 0, 0);
}
transform.Rotate(0, Input.GetAxis("Mouse X") * mouseSpeed * Time.deltaTime, 0);