Can be deleted

Please use code tags if you submit code in the forums:

Here is an example how to clamp rotation, it is from elsewhere, feel free to adapt it to your needs:

float minRotation = -45;
float maxRotation = 45;
Vector3 currentRotation = transform.localRotation.eulerAngles;
currentRotation.y = Mathf.Clamp(currentRotation.y, minRotation, maxRotation);
transform.localRotation = Quaternion.Euler (currentRotation);