- Home /
Question by
Kazishadab · Mar 28, 2017 at 07:09 AM ·
unity 5uislider
UI Slider value gets stucked in loop and Doesn't increase further
I have created a script to update slider with video seek position. The variables that I have used fetches the correct value and updates properly but as soon as I use that variable to update slider.value it gets stucked in loop.
public class fullScreenControl : MonoBehaviour { public Slider videoSlider; public float sliderValue; public void Update(){ sliderValue=(float)Math.Round(((scrMedia.GetSeekPosition ())*1.0f)/(scrMedia.GetDuration()*1.0f),3); // returns value between 0 to 1 videoSlider.value = sliderValue; // stucks in loop after adding this line }
Comment