# How to destroy sliders?

**URL:** <https://discourse.processing.org/t/how-to-destroy-sliders/30629>\
**Category:** Coding Questions\
**Created:** [June 10, 2021, 2:54pm UTC](https://discourse.processing.org/t/how-to-destroy-sliders/30629 "2021-06-10T14:54:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![olaf000olaf](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/olaf000olaf/32/11295_2.png) [@olaf000olaf](https://discourse.processing.org/u/olaf000olaf)\
**Post date:** [June 10, 2021, 2:54pm UTC](https://discourse.processing.org/t/how-to-destroy-sliders/30629/1 "2021-06-10T14:54:37Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [June 10, 2021, 3:24pm UTC](https://discourse.processing.org/t/how-to-destroy-sliders/30629/2 "2021-06-10T15:24:34Z")

</div>

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

Do you use clear() for your canvas?

---

<div class="post-metadata">

**Author:** ![olaf000olaf](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/olaf000olaf/32/11295_2.png) [@olaf000olaf](https://discourse.processing.org/u/olaf000olaf)\
**Post date:** [June 10, 2021, 5:38pm UTC](https://discourse.processing.org/t/how-to-destroy-sliders/30629/3 "2021-06-10T17:38:09Z")

</div>

> **[My Sketch - OpenProcessing](https://openprocessing.org/sketch/1215673)**

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

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [June 10, 2021, 5:57pm UTC](https://discourse.processing.org/t/how-to-destroy-sliders/30629/4 "2021-06-10T17:57:05Z")

</div>

[p5js.org/reference/#/p5.Element/remove](http://p5js.org/reference/#/p5.Element/remove)
