Slider is not interactable if I set the value from script

I set the slider value incremented from script this makes the slider not interactable during runtime
this my code for this

            Seeker.minValue = 0;
            Seeker.maxValue = GetDuration();
            progress = Mathf.Lerp(0, Seeker.maxValue, m_iCurrentSeekPosition / Seeker.maxValue);
            SliderTxt.text = progress.ToString();
            Seeker.interactable = true;
            Seeker.value = progress;

It’s because you set the value of the slider each frame, overriding the input of the user.

  1. Detect the OnPointerDown event on the slider and disable the update of the value (a simple boolean with a condition will be enough)
  2. Detect the OnPointerUp event on the slider and enable back the update of the value

To detect these events, use the EventTrigger component using the inspector or do it all by code :