Set/Get Child Actor Variable(s) inside function

I’m wondering if it exist any way to set or get Variable from a Child Actor inside the construction script or Functions in a blueprint, and if not can it be a new feature in next versions ?

Actually you can only set child actor variable on the Details tab of the component, here is an example of one child actor with 2 Variables, Variable 01 a Float and Variabe 02 a Boolean :

140193-screen01.jpg


Here is some “fakes” of what I would like to do :

Or like in this way :

Good idea ? Tell me :wink:

You have to use the nodes GetChildActor and then cast it to the correct actor. Then it works.

HTH

Yes I know, it works on functions like BeginPlay or anything, but it doesn’t work on the construction script.

An example :
My child actor is a lamp, on his own construction script I put a boolean, when it’s true : the light turn ON.

But if I set this boolean “true” on an other construction script inside an other blueprint, through a childactor with a Cast, it doesn’t work.

The construction script of my childactor :

The construction script of the main blueprint :

Like that, the lamp (ChildActor) won’t turn ON

1 Like

You never call the super construction script so it is never executed. Call the super construct function.

How to do that ?

Right click on the construction script node and select add call to parent script or something similar.

Ok I’ve created it, but I don’t know how to use it x)

up please ?