How to drag multiple objects from a scene into an array?

In Unity I was able to just grab them and drag on top of the array/list and it went there. Looks like in UE I would have to do them all one-by-one. I’ll have about 150-250 of those in my actual level and they need to be added in a specific order.

Alternatively, in Unity C# I can access that “folder” and add them like:

Transform folder;
int stuffcount = folder.GetChildCount();
List<Transform> allthestuff = new List<Transform>();

for(int i=0; i<stuffcount; i++)
{
  allthestuff.Add(folder.GetChild(i));
}

How do I do that in UE (the drag and drop part if possible)? I’m really struggling with everything right now. Thanks.

Don’t think you can simply drag and drop to an array.

You can however create functions that do the work for you:

This will return actors of a specific class with the specified actor tag.

These references will not be in order. You can for example add a second tag with a number and use it to sort.

You can enable Call In Editor on the function to manually update the array or place the function in the Construction Script (just be careful here, might make it hard to work with):


Feel free to ask anything.

Hope it helps.

2 Likes

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