- Home /
How to make slider load variable on start
Hi guys, new problem. Can't find answer. How do I make a slider in unity 4.6 load a variable float on start up. So basically when it loads it pulls a float number from a variable that is between 0 and 1 and positions the handle in the correct spot?
screen-shot-2015-03-04-at-194444.png
(16.3 kB)
Comment
Answer by sniper43 · Mar 04, 2015 at 10:43 AM
void Start()
{
ThisSliderReference.normalizedValue = RandomFloatBetweenOneAndZero;
}
http://docs.unity3d.com/460/Documentation/ScriptReference/UI.Slider-normalizedValue.html
Ask me if you're confused about anything.
Your answer
Follow this Question
Related Questions
4.6 - Using new GUI with JavaScript functions 1 Answer
Can I show a numeric variable from the slider on the GUI? 1 Answer
Can I use the new GUI system with instantiated prefabs? 1 Answer
How can i detect changes on a GUI slider? 1 Answer
How to make a Horizontal Slider slide between resolutions? 3 Answers