How to clear(delete) all meshes that are instanced in the construction script?

How do I clear(delete) all meshes that are instanced in the construction script?
When I use Clear Instances in the Event Graph, it only removes the static meshed that are instanced in the Event Graph but the ones instanced in the Construction Script remain.

You need to keep an array of instanced made in the CS. Each time the CS starts, remove them all, and re-make them.

can you expand it a bit please?

You need to keep an array of instanced made in the CS

  1. why do I need to keep an array when I want to clear all instances that are instanced at any moment?

Each time the CS starts, remove them all, and re-make them

  1. where do I remove them exactly and how?

Create a variable mesh type as array
each time you spawn a mesh add it to array

and when you want to remove them you could for loop the array and destroy actor or component for loop index

1 Like

this doesn’t answer why I can’t use Clear Instances which does the job exactly for those instanced in Event Graph

you keep them on array for reference to meshes that you created

as well you need to track them on gameplay and delete them