Get all actors + destroy actor doesn't destroy emitters

The blueprint spawns an emitter. So, I would also like to delete the emitter.

I want to know how to use the get all actors of class node to delete all actors of that class via button widget click. I tried a for loop and for each loop, but it doesn’t delete the emitter, it only deletes the blueprint that spawned it.

Not sure about your set-up here. Is the emitter a “component” of an actor? Because if you try and “delete actor” it destroys the entire actor. If you want to delete a “component” you need to use that node instead. This leaves the actor blueprint intact and just deletes a component from the details panel of that actor. Second, when I was trying to do this I noticed if you hover over the “destroy component” node it states you can only call this from the actor containing the component. So you need to “get all actors of class” from a separate blueprint like your character and then when you loop through instead of “destroy actor” you would need to call a custom function that then runs a script with the “destroy component” node.

If you actually want to delete the entire actor that shouldn’t be hard and that set-up should work. The only place where this could go wrong and I can’t tell based on the above screen shot is, if the “emitter” is a blueprint itself, you must not be finding the right “actor” for “get all actors of class”, otherwise it should be destroying it with this set-up. Do you have duplicate actors with similar names? Or this script is just not being called.

The emitter is being spawned only within the bp_spawnStatic blueprint as a component. I tried to destroy component within the for loop, but calling the function instead as above seemed to have worked. Thanks

Cool! glad it’s working.