How to add child actor components to Array?

Hello,

I am simply trying to use the eyedropper from my child blueprint to grab other child blueprints. For some reason it doesn’t let me, as shown below:

The child actor is not instantiated yet. You should be able to do it in the Construction script, get the object instance from the child actor and add it to the array.

I’m sorry, I’m not sure I understand. Could you explain more?

If your actor is already in the Level - placed manually, you can use its Begin Play event to populate the array with its Child Actors like so:

You may want to cast the child before adding it to the array, depending on what you need (perhaps they’re different classes).


Also, you probably do not want to do it manually - one by one. Think about it, what if you have 100s of these to drop… Even what I posted can be further automated with tags.


edit: I’ll admit that I do not fully understand what you want to achieve. You’ve selected a child actor and want to add something to that child actor’s array? Or…?

1 Like

What I am trying to do is create procedural rooms. I have control panels that need to move platforms. I want to add the platforms to the array in the control panels. All are child actors of the room piece. I tried to do this, but It didn’t work.

Does the event fire? Are the child actors classes set? Are the casts successful?

The event above fires. However, when I activate the control panel, nothing happens. The other child actors are set in the viewport but not in blueprint.

The event above fires.

on Begin Play? And the casts do not fail? Print the content of the array to see if it actually populates.

The other child actors are set in the
viewport but not in blueprint.

That should be fine.

The cast passes and the correct actors populate the array. Here are the individual actor blueprints if that helps.

The cast passes and the correct actors
populate the array.

So that solves it.

However, when I activate the control
panel, nothing happens.

What is supposed to happen here? Does it Print?

I figured it out!

I was sitting at my desk staring at it when it occured to me- maybe I should ALSO cast the platforms to their respective actor, and make the array and actor array, NOT a child actor array. Worked instantly.

Thanks for the help!

Awesome!

Good luck with the rest!