Mathf.clamp Unity

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