increase/decrease the value of slider a little slowly

Hi…!
I am using a slider in way a that a object catches another object and its according to value of other object my slider value changes accordingly. when slider value changes its handler goes directly to that value. I want to go slowly like its filling up, like we fill a water of glass in real life. Any Ideas how can I do it?

Sorry for bad English. Thanks in advance. :slight_smile:

Like this?

float timeToWait = 0.5f;
    float fillQuantity = 0.1f;

    public void Start()
    {
        StartCoroutine(FillSlider());
    }
    public IEnumerator FillSlider()
    {
        yield return new WaitForSeconds(timeToWait);
        slider.value += fillQuantity;
        StartCoroutine(FillSlider());
    }