Hello I would like to add a slider to my unity3d project, I am using c# script and the following code.
public float hSbarValue;
void OnGUI() {
hSbarValue = GUI.HorizontalScrollbar(new Rect(25, 25, 100, 30), hSbarValue, 1.0F, 0.0F, 100.0F);
}
This draws a slider that i have to use the mouse to drag it.
I want to turn it into a slider that moves on its own (like ping pong effect) until a button is pressed and then store the value in the hSbarValue variable.
Any help is appreciated