Duplicating and Removing Static Mesh several times based on a slider

I am trying to take one of the static meshes that are in my bp and duplicate it several times with a specific move transformation. I was able to get duplication “working” with with using a for loop and add static mesh component. So when I drag from 0 to 1 I get an appropriate number of them created, the problem is when I then drag from 1 to 0 they are not going away. Actually after checking the print string it keeps making more of them over the top of each other.
Here is my screen grab image

Bumper Cars

Hi man ,
Based on what you want to do next, can be trycky work with static meshes that may or not exist.
I suggest you to create these static meshes and use the slaider to active / deactive and set them visible or not.

That’s my plan B at the moment, however I will be dealing with like 90 objects. I can brute force it but I really rather figure out a dynamic system. When you say tricky does it mean it’s not really possible or recommended, or it is possible just takes a lot of time.
Thanks for your input btw!

Ok if there are 90 objects…
I am pretty sure that you can build up a vector of the type of static meshes and store there all your static meshes .
Did you used the destroy component ? why they dont go away?
in your screenshot you just add static mesh…

I am not sure how to use a destroy component exactly. What I mean is that how should I structure the date so it kills off the meshs that need to be out and leaves others in place. Or how to destroy all of them and re run the function to create new once because the slider value has changed.
Here is what I’ve tried and it’s not really working. should I be using the component some other way?
The function is hooked up to on slider change event

Hi , this is how take care about the static meshes, i am not sure about the difference of using the instanced, but you should do the same.

I have used the key event , but you can sure attach this to a loop that get fired by your slider.

I’ve copied your script exactly (inset of keyboard driven I have 2 test buttons in UMG to trigger creation and destroy). I am having an issue with the destroy component still, the mesh (in game) still stay at what ever last highest number it was last. I hooked a print print sting to the end of – to see what the count is at, and it’s printing a correct number every time button is clicked, however the mesh data doesn’t go away in the view. Hopefully this makes seance to you…

Still having issues with this thing…

Hi man ,
Take every step on piece at time , if you still dont get
post your blueprint.