How to get the child actors attached in World Outliner?

I have actors I’ve attached to a parent actor in the World Outliner.

312494-screenshot.jpg

In the blueprint of Parent, how do I access the attached children?

I’ve tried Get Attached Actors and Get All Child Actors in my ArrayObjects blueprint class but both return empty arrays. I need this to run at editor time because it’s part of level editing automation, if that makes any difference.

If you’ve attached them in the level, then you need to use GetAttachedActors from the level BP, or a widget or another actor in the scene.

If you’ve made the children as components of the parent ( inside the BP ), then you can use GetAllChildActors.

2 Likes

Ugh, I figured it’ll be something like that. Thanks.

ClockworkOcean… could you explain a little more on how you would use ‘another actor in the scene’ to help with the OP’s request?

Sure. I meant, you could drop a blueprint in the level, that has a reference to the ‘main’ actor, and then can get the attached actors.

Awesome. Got it.

Also, putting a blueprint in the world to talk to ( and from ) is far easier than the lengths people go to when they try and talk to the level blueprint.

But like… Why does it return nothing when an actor queries its own child? Seems like a legitimate request to me.
Using another actor for that really breaks encapsulation.
Using the level sounds like more logical, but I wish there was a way like “getLevel->QueryActorAttachedChildren” to call from within the actor. I don’t want to write bespoke code in my level blueprint either.

Is there any well encapsulated way to request the ouliner children?

Answering my own question here:

You can use “Get Attach Parent Actor | Unreal Engine Documentation” and “Get Attached Actors | Unreal Engine Documentation” to walk up/down the attachments in the level outliner,

HOWEVER. you can’t get your parent onBeginPlay, you have to wait for a few frames.

I haven’t been able to get an actor children in a packaged build at all, it’s always empty.
I’ve even put it in a tick and it always return a zero sized array.

Works normally in editor tho.