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