How to get child actors?

Lets say I have something like this:
image

I want to get all actors (including subActors) from Root Actor BP_Ship010.
How to do that?
I saw numerous topics about this but didnt get the answer (or didnt understand) :frowning:

My Bad. I found the answer for future generations:
image

2 Likes

this should give you all of them

Set class to Actor, or make BP_MyBaseActor that is just empty blueprint.
And create all those actors as child (inherited child, not as in component tree).

Then because all of them inherit from BP_MyBaseActor you can get Components by class and use that as class.

Ps.

If you need all those actors to communicate with, you will probably make list of them then for each loop and do something to them. Less haslle is to make dispatcher at root actor, make all of those hook to it and listen to dispatcher event. Makes code for dispatcher same in every actor, no need to cast and check if its valid etc (after initial hook).

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.