attaching actor to actor


I want to spawn new actor and attach/parent it to another one. I have few options here, and I am very confused which one I should use and whats the difference between them.

  1. SpawnActor from Class and AttachActorToComponent


  1. SpawnActor from Class and AttachActorToActor


  1. AddChildActorComponent


Is there any fundamental difference between those methods ?

Once I do any of them, I try to get children and destroy them. Well, I try but no luck :slight_smile: I call this from the same actor as I spawn them.
I tried another way of destroying them, to make a function in spawned actor that destroys self, but. I cannot cast from GetChildrenComponents to parent class of spawned actor to call this function. It only allows me to cast to components, not actors.
Basically attached actor became a component, I dont quite get this part.


Help in any way please!


From that Array Element node you can use Get Owner node to get the Actor class that owns that component. You can then Cast that Get Owner node to your specific actor class.


thanks, thats exactly what I needed.