How to set Variables in Child Actor Component

Hello,

I am adding Child Actor Components with their own Construction Logic based on some variables. I need to change those variables in the main BP before the Child Actor Construction logic is run.

The node Child Actor Components doesn’t provide inputs of Exposed On Spawn variables.

If I cast to those actors and change the variable later - it doesn’t reflect in the editor, probably because the Construction logic is already finished right after the child actor was added.

Btw, The variables are available in the Details tab of Add Child Actor Component Node. But I need to connect them to the Variables of my main BP, and I don’t see a way to do that.

Is there any ways to change variables for Construction Logic of my Child Actor Components?

Many thanks.

1 Like

If you use a ‘get child actor’ node then cast, you can access everything in the child, including ‘run in editor’ events.

So I think you can call the event from construction ( so the child still works normally ), but then call it again from the parent.

and the construction script in the child is just

and


@ClockworkOcean

Hello ClockworkOcean. Thank you for the attention to my problem.
Yeah, I believe I did exactly the same.
But it doesn’t work, probably due to the fact that initially
the Child Actor does it’s Construction Script before changing variables in it by the Parent BP.

Do you think it can work like that?

I mean, I probably just have to move the logic from Construction Script to EventGraph…
But I would prefer something like: ReDo the Construction Script if it was possible.

Edit: Aaaah. Actualy I gotcha what you mean. Transfering the whole construction logic to an event (not only variables change) and call it anytime from any Construction script.
Yeah. That solves it :sweat_smile: Thank you.

1 Like

Yes, the child runs its construction when its attached, but then you can run it again from the parent :slight_smile:

1 Like