Hi, i want that the camera rotates only if it has not reached more than 70° or less than -70°, but even with this script it always rotates
public GameObject cameraGO;
public float MSensibility = 10f;
void Update()
{
//Camera Movement
if (Input.GetAxisRaw("Mouse Y") < 0 && cameraGO.transform.localRotation.x < 70)
{
cameraGO.transform.Rotate(-MSensibility * Input.GetAxisRaw("Mouse Y") * Time.deltaTime * 10, +0, +0);
}
if (Input.GetAxisRaw("Mouse Y") > 0 && cameraGO.transform.localRotation.x > -70)
{
cameraGO.transform.Rotate(-MSensibility * Input.GetAxisRaw("Mouse Y") * Time.deltaTime * 10, +0, +0);
}
}