Attached Actors not getting destroyed?

On an overlap event my actor spawns other actors from a class. I add these actors to an array, but it is not destroying them. Shouldn’t these attached actors be removed when I destroy the parent actors anyways?

If I understand correctly Actors do not really have any ownership over other actors. Actors and Components have an “Outer” which is a property that defines who owns them. Component’s Outers are usually their creator but you can assign a specific one in a Create Component node. Actors on the other hand are owned by the level they are in. They have no auto clean up really until the level is cleaned up.

You will need to clean up any actors you spawn yourself. Often this is easily done by adding an event to your spawning actor for OnDestroyed which will allow you to iterate your array of actors and call Destroy or set AutoDestroyWhenFinished to complete.

Thanks for the reply! I think I understand actors a little better now. My problem was fixed by using “Add Child Actor Component” instead of Spawn Actor from class. This way when I delete the parent, the child actor components also go away

Also a solution! Cool.

Expanding on this, components will be cleaned up. Actors using the spawn actor node will not.