Im using a horizontal slider to change a value.Say the start point is 'A' and the end point is 'B'.I want the slider to only move from A to B and restrict movement from B to A.
Any ideas on how i could get that to work?
Im using a horizontal slider to change a value.Say the start point is 'A' and the end point is 'B'.I want the slider to only move from A to B and restrict movement from B to A.
Any ideas on how i could get that to work?
I'd probably just do it in OnGUI(), e.g. (untested):
float newValue = GUI.HorizontalSlider(..., currentValue, ...);
currentValue = Mathf.Max(currentValue, newValue);
Poll your slider in the Update() Method.
If the value of the slider goes below the current slider value:
if(newSliderValue < currentSliderValue) {
newSliderValue = currentSliderValue;
} else {
currentSliderValue = newSliderValue;
}
Set it to the current value instead of the new one.