How to destroy sliders?

I have a slider that makes other sliders, and whenever I change the value of the first slider I create that amount of them. For example, the main slider is set to 3 then I make three sliders below, but whenever I change it to a new value the array is cleared but the sliders still show, how do I prevent this?

you should really show your code, like you make the secondary sliders.

Do you use clear() for your canvas?

Currently, the other sliders don’t do anything, they are located at the top left.

p5js.org/reference/#/p5.Element/remove

1 Like