How to add selected actors to an array?

In Kismet, you were able to add a massive selection of actors into a single object list. I’m trying to do this in UE4, but am not having any luck. Ideally you could make your selection in the level, and then in the blueprint right-click and choose Make Array to automatically add all the actors into a new array. To keep things clean afterwards, you can collapse to a node as well, winding up with essentially an object list.

Is there any similar functionality I’m over looking?

Thanks –

Hey kayoti,

There isn’t a direct method to group-select a bunch of actors in your level, right-click in a blueprint and add them all to an array instantly. Something you could do that is similar, though, is in your Level blueprint you can make an Object array variable, drag a Set for that variable into the blueprint, create a Make Array node and plug that in to get a Make Array taking any number of Objects:

7749-makearray.png

After that, you could group select all the actors in the level you need to add to that object array, right-click inside the Level blueprint and select Add references to selected Actors. This will add a reference for each actor you selected, which you could add to the Make Array via the input pins (use the Add pin + to add as many inputs as you need).

Continued…

1 Like

Alternatively, if you know you need all of the Actors in the level of a particular class, you could use a Get All Actors of Class node to get an array of the class type you need. Furthermore, if you use the Tag feature on the Actors placed in your level, you could use a setup like this to get all actors that have that tag:

Hope this helps!

1 Like

Thanks, the method of adding tagged actors to an array works well. I’ve created a macro of this for quick re-use!

How would you use this Array to create a Tag for multiple players (in a multiplayer game)?

, Can you explain how you got this to work outside the Level BP?

That’s what I thought. Thanks for the quick reply!

Hi MaroonersRockAnimation,

Very old question from 2014, The above post from can’t be done outside the Level Blueprint as Level Blueprint has access to access in the Level. If you were trying to add a list of actors to an array outside the Level Blueprint look at the first screenshot in this answer. If you have further issues I would recommend creating a new question so people can address you directly.

You can use a blutility in conjunction with “get selection set”

1 Like

Found this super helpful this evening. Thanks!

Can someone post a C++ example of this?

Hi, could you show a quick example of how it is done?
I found the “get selection set” node but could not figure out how to feed the output to a list on another actor.
Thanks!