- Home /
The question is answered, right answer was accepted
is it Possible to Move a UI Slider remotely by script? If So How
We are working on getting the buttons & toggles in our interface to be activated by Voice command. I was then confronted with the issue of if we could do the same thing with UI Sliders?
Has anyone been able to operate a UI slider remotely using C# something like
Move slider up (Code)
Move Sider Down (Code)
Answer by Effervescence · Aug 21, 2016 at 01:46 PM
Yes, just get a reference to the slider object and then manipulate its value.
using UnityEngine.UI;
public Slider yourSlider;
public MoveSlider(int num) {
yourSlider.value = num; //num should be from 0 to 1, because that's the range of a slider
}
Then why my slider doe not move? Please refer to this, any help appreciated.
Follow this Question
Related Questions
Simple button script help 2 Answers
Distribute terrain in zones 3 Answers
How to make if limit is reached then make sliders only slide back in ui (not forward) 2 Answers
How to move slider same amount with different max values when moving it by a percentage Unity 1 Answer
How to create a slider in-script? 1 Answer