Mathf.Clamp Unity
//stops "value" from getting smaller than xMin and bigger than xMax.
float value = Mathf.Clamp(value, min, max);
Inexpensive Iguana
//stops "value" from getting smaller than xMin and bigger than xMax.
float value = Mathf.Clamp(value, min, max);
float value = Mathf.Clamp(10, 1, 15);
float value = Mathf.Clamp(10, 1, 15);