Help me with slider

I am trying to create players health using the sliders im testing out now on trigger enter to minus sliders value to 1 what happens is that it seds my value to 0 any idea why it happens ? I think it has something to do with this line but i can’t work it out.

playerHealthSlider.value = Mathf.MoveTowards(playerHealthSlider.value, 100f, 0.15f);

Solved.

I think you want line 13 to simply assign the current value of playerHealth to your playerHealthSlider.value.

I found the problem it was that i didn’t changed the max value for the slider it was set to 1…oops.

Thanks for the help : )