# child actor component change variables

**URL:** <https://forums.unrealengine.com/t/child-actor-component-change-variables/696027>\
**Category:** Blueprint\
**Tags:** unreal-engine, UE5-1, Blueprint, question\
**Created:** [November 21, 2022, 4:09pm UTC](https://forums.unrealengine.com/t/child-actor-component-change-variables/696027 "2022-11-21T16:09:44Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![fedco.dev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@fedco.dev](https://forums.unrealengine.com/u/fedco.dev)\
**Post date:** [November 21, 2022, 4:09pm UTC](https://forums.unrealengine.com/t/child-actor-component-change-variables/696027/1 "2022-11-21T16:09:44Z")

</div>

I can’t make changes to a child object variable. Can someone tell me how to do this?  
I make a cast in the construction script and enter a new value, but nothing happens. Both in the editor and after starting the game (

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/c/3/1c345cc0a538be3fe22a650df9d99493e0d20be2.png)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [November 21, 2022, 5:05pm UTC](https://forums.unrealengine.com/t/child-actor-component-change-variables/696027/2 "2022-11-21T17:05:49Z")

</div>

I don’t think you can. The Football Actor does not really exist as a PIE actor until The Stadium initialises the **C** hild **A** ctor **C** omponent which will _only then_ spawn the Football.

This will work run-time on _Begin Play_, sure. Just not in the editor and probably not very well or at all in the CS. Wish CACs were smarter.

---

<div class="post-metadata">

**Author:** ![RecourseDesign](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/recoursedesign/32/1194503_2.png) [@RecourseDesign](https://forums.unrealengine.com/u/RecourseDesign)\
**Post date:** [November 21, 2022, 6:25pm UTC](https://forums.unrealengine.com/t/child-actor-component-change-variables/696027/3 "2022-11-21T18:25:24Z")

</div>

The bit you’ve highlighted in Red is just the Template - in C++ you can get both the ChildActor and the ChildActorTemplate but I haven’t seen anyway to access that template from Blueprint.

From my experiments, the ChildActor is constructed (with those defaults from the template) before you get to the ConstructionScript.

If you do a printstring on the BP\_Football LinesCount before changing it to 0, it should be 22 - if you do a printstring after setting it to 0 (or in the PlayEvent) it should be 0.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/d/2/ad21076c5160438a9a0b28c6b5e56938f37971cf.jpeg)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [November 23, 2022, 9:11am UTC](https://forums.unrealengine.com/t/child-actor-component-change-variables/696027/5 "2022-11-23T09:11:31Z")

</div>

I am a bit confused; if I do this:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/8/4/c8451a3ef845f26f2231fb60a92717dfa0943591.png)

With no Begin Play or Construction Script, the value of the Child Actor changes correctly. I’m doing it in 4.27. Is this not working in UE5?

This also _works_ if you assign the value on Begin Play. But… The CAC will initialise the `debugChild` from the template, with _defaults_. The int will be 0 initially, only to be set by the owner’s (debug) Begin Play after the debug child is instantiated:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/9/5/e9568b137d2f378ad6f35512e846b9aea07ce00c.png)

If this is done in the CS:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/b/b/7bbf7861085a3dbe2e4a9ee4ce1898ba4946a81a.png)

It also works (which I did not know about until now since it did not before 4.22 or thereabout)

In the last case, the CAC’s actor actually spawns with 22.

If the above does not work in UE5 - it’s either a bug or the new _feature_.

* * *

What I would really like the CACs to do in BP is to give me an instance of the template here:

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/e/2/5e2fd06b27404d15429e7bd23875820f7e0db850.png)

There is a great post somewhere in the Knowledge Database on the way the CAC’s are used in Fortnite - they were supposed to be developed further but it never happened.

---

<div class="post-metadata">

**Author:** ![fedco.dev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@fedco.dev](https://forums.unrealengine.com/u/fedco.dev)\
**Post date:** [November 23, 2022, 9:25am UTC](https://forums.unrealengine.com/t/child-actor-component-change-variables/696027/6 "2022-11-23T09:25:05Z")

</div>

> [@Everynone](#):
>
> Or are you trying to dynamically override the default of the child actor component’s actor during PIE?

I use UE 5.1. If you specify the actor directly, then I can also change these settings in the template from the right, but I need to change this value in the blueprints constructor via blueprints. There’s no way I can do that(

---

<div class="post-metadata">

**Author:** ![fedco.dev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@fedco.dev](https://forums.unrealengine.com/u/fedco.dev)\
**Post date:** [November 23, 2022, 9:25am UTC](https://forums.unrealengine.com/t/child-actor-component-change-variables/696027/7 "2022-11-23T09:25:57Z")

</div>

I tried to specify the actor directly and nothing worked the same way. At the start of the game, nothing changes in either case.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [November 23, 2022, 9:34am UTC](https://forums.unrealengine.com/t/child-actor-component-change-variables/696027/8 "2022-11-23T09:34:22Z")

</div>

Fleshed out my post in case you missed the edit.

* * *

> a great post somewhere in the Knowledge Database

Not as great as I remember it ;p

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/3/2/632d843a3ea2779c07133332328ae1bb64e018ca.png)

---

<div class="post-metadata">

**Author:** ![RecourseDesign](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/recoursedesign/32/1194503_2.png) [@RecourseDesign](https://forums.unrealengine.com/u/RecourseDesign)\
**Post date:** [November 23, 2022, 6:10pm UTC](https://forums.unrealengine.com/t/child-actor-component-change-variables/696027/9 "2022-11-23T18:10:29Z")

</div>

> [@fedco.dev](#):
>
> I use UE 5.1. If you specify the actor directly, then I can also change these settings in the template from the right, but I need to change this value in the blueprints constructor via blueprints. There’s no way I can do that

Check the snapshots I’ve put in my first answer. You CAN change those settings in your Construction Script.

---

<div class="post-metadata">

**Author:** ![fedco.dev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@fedco.dev](https://forums.unrealengine.com/u/fedco.dev)\
**Post date:** [November 24, 2022, 1:15pm UTC](https://forums.unrealengine.com/t/child-actor-component-change-variables/696027/10 "2022-11-24T13:15:25Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/b/8/7b849ae73f86bbb996c6d44b95fc4b43dc833b02.png)  
He still doesn’t want to change anything. I’m trying to set the color black and nothing happens. Most likely this is a UE5 bug. I tried to upgrade to 5.1, but Epic Games broke the banal migrate and it doesn’t work now. By the way, LOD’s in UE5 are also broken. I made a post on this issue, but no one has answered me yet [UE5 LOD bug on skeletal mesh](https://forums.unrealengine.com/t/ue5-lod-bug-on-skeletal-mesh/696025)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [November 24, 2022, 1:22pm UTC](https://forums.unrealengine.com/t/child-actor-component-change-variables/696027/11 "2022-11-24T13:22:42Z")

</div>

> [@fedco.dev](#):
>
> I’m trying to set the color black and nothing happens.

How are you testing it? What does “nothing happens” mean? How, and to what, is that colour applied?

---

<div class="post-metadata">

**Author:** ![RecourseDesign](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/recoursedesign/32/1194503_2.png) [@RecourseDesign](https://forums.unrealengine.com/u/RecourseDesign)\
**Post date:** [November 24, 2022, 5:16pm UTC](https://forums.unrealengine.com/t/child-actor-component-change-variables/696027/12 "2022-11-24T17:16:45Z")

</div>

> [@fedco.dev](#):
>
> I’m trying to set the color black and nothing happens

It won’t change in your ActorTemplate - that is a separate object that is only used to construct the actual child - it changes it in the actual child actor - I have tested this in 5.1 and it works.

If you check the color from a “ChildActor” node, it should be correct.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [November 24, 2022, 5:48pm UTC](https://forums.unrealengine.com/t/child-actor-component-change-variables/696027/13 "2022-11-24T17:48:33Z")

</div>

> [@RecourseDesign](#):
>
> It won’t change in your ActorTemplate

Wait, wait, wait. @fedco.dev are you expecting this value to change:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/3/4/e34f974c3a2140de1c75144a3197133655bcdcbe.png)

Here in the panel? That will not work.

---

<div class="post-metadata">

**Author:** ![fedco.dev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@fedco.dev](https://forums.unrealengine.com/u/fedco.dev)\
**Post date:** [November 25, 2022, 9:49am UTC](https://forums.unrealengine.com/t/child-actor-component-change-variables/696027/14 "2022-11-25T09:49:15Z")

</div>

> [@RecourseDesign](#):
>
> It won’t change in your ActorTemplate - that is a separate object that is only used to construct the actual child - it changes it in the actual child actor - I have tested this in 5.1 and it works.
> 
> If you check the color from a “ChildActor” node, it should be correct.

Yes. I am trying to change these parameters. These are the settings of “an actor inside another actor” How can I do this? If I go to another actor directly, these parameters will be available in the Settings panel I created. But as soon as I add this boat as a child to another actor, these settings become inaccessible for simple editing and even through blueprints I can’t change them in any way ((

---

<div class="post-metadata">

**Author:** ![fedco.dev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@fedco.dev](https://forums.unrealengine.com/u/fedco.dev)\
**Post date:** [November 25, 2022, 9:57am UTC](https://forums.unrealengine.com/t/child-actor-component-change-variables/696027/15 "2022-11-25T09:57:04Z")

</div>

Yes, I understand that it will not be possible to change these parameters now. I took this screenshot to make it clear what I want to change at all. How can I influence these parameters? What’s the secret?))

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [November 25, 2022, 9:59am UTC](https://forums.unrealengine.com/t/child-actor-component-change-variables/696027/16 "2022-11-25T09:59:57Z")

</div>

There is no secret. You either punch in the value in the field manually or use Construction Script. This works in 4.27, and now we know it also works in UE5.

Perhaps the issue is in the testing methodology and your expectations. Could you please demonstrate how the variable is not changed in the child actor? I’ll repeat my question:

How are you testing it?

* * *

If we can’t replicate the exact issue you’re having, we can’t help.

---

<div class="post-metadata">

**Author:** ![fedco.dev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@fedco.dev](https://forums.unrealengine.com/u/fedco.dev)\
**Post date:** [November 25, 2022, 10:10am UTC](https://forums.unrealengine.com/t/child-actor-component-change-variables/696027/17 "2022-11-25T10:10:08Z")

</div>

I will try to describe what I want to do and maybe you can help me. Imagine that you have BP\_house (parent Actor) and it has a parameter (open or close the door). Let’s say this is a Boolean variable available for configuration. It opens and closes the doors of your home through the construction script. You can place this actor at your level and the level designer can adjust this variable as he likes. Now let’s create another BP\_id (parent Actor) and by analogy it will have a Boolean variable that is responsible for the lowered bucket or the raised one. There can be a lot of very different such objects. And now the most interesting thing. We create 1 more BP\_entourage (parent Actor). In it, we implement logic through a construction script where we can select any of our BP created above and change their settings (raise or lower the bucket - if it’s a well, open or close the door - if it’s a house, etc.) One by one in these BP actors, these settings are visible on the tab from the right, but when we if we add these settings to our BP\_entourage, then there are no more settings and the level designer cannot configure them. All he can do is choose only the actor that he wants, and he will not be able to set up this actor. It is necessary to search for this BP in the editor and change its settings by silence, but then all such actors on the world map will immediately change their appearance. I hope you understand what I want to do.))

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [November 25, 2022, 10:12am UTC](https://forums.unrealengine.com/t/child-actor-component-change-variables/696027/18 "2022-11-25T10:12:36Z")

</div>

This is the exact _wish_ I described here, the very last image:

> [@child actor component change variables](https://forums.unrealengine.com/t/child-actor-component-change-variables/696027/5):
>
> I am a bit confused; if I do this: With no Begin Play or Construction Script, the value of the Child Actor changes correctly. I’m doing it in 4.27. Is this not working in UE5? This also works if you assign the value on Begin Play. But… The CAC will initialise the debugChild from the template, with defaults. The int will be 0 initially, only to be set by the owner’s (debug) Begin Play after the debug child is instantiated: If this is done in the CS: It also works…

Child Actor Components do not support the behaviour, rendering them useless in such cases.

* * *

A workaround is to give the component owning actor an Instance Editable variable and push its value into the CAC’s actor through the CS. If that does not work, you may need an _Editor Callable_ custom event and run the script from there.

---

<div class="post-metadata">

**Author:** ![fedco.dev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@fedco.dev](https://forums.unrealengine.com/u/fedco.dev)\
**Post date:** [November 25, 2022, 10:25am UTC](https://forums.unrealengine.com/t/child-actor-component-change-variables/696027/19 "2022-11-25T10:25:04Z")

</div>

Yes. It looks like I’ll have to abandon this idea, or try to do it through events as you said. Or through the interfaces, you can also try.

---

<div class="post-metadata">

**Author:** ![RecourseDesign](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/recoursedesign/32/1194503_2.png) [@RecourseDesign](https://forums.unrealengine.com/u/RecourseDesign)\
**Post date:** [November 25, 2022, 6:38pm UTC](https://forums.unrealengine.com/t/child-actor-component-change-variables/696027/20 "2022-11-25T18:38:52Z")

</div>

> [@fedco.dev](#):
>
> Yes. I am trying to change these parameters. These are the settings of “an actor inside another actor” How can I do this? If I go to another actor directly, these parameters will be available in the Settings panel I created. But as soon as I add this boat as a child to another actor, these settings become inaccessible for simple editing and even through blueprints I can’t change them in any way ((

A Quick and Dirty way of doing it would be to add those properties to the Parent actor, and pass them through to the child actor in the Construction Script, but if you’ve got a lot of different types of child actors you want to add, it could get bloated.

Another option could be, rather than use ChildActorComponents, you could create new actors in the scene and just “Attach” them to the parent by dragging the child onto the parent in the World Outliner - you can still select them in the editor then and change their properties.

You can Spawn those Attached actors from a Blueprint too, but you’re in charge of making sure you don’t go creating new versions without destroying the old ones - and you can’t spawn them from the Construction Script.

I have to admit I’m almost at the point of releasing a new plugin that has Managers built in for automatically handling ChildActors, AttachedActors and Instanced Static Meshes - a good solution for your situation would be to use the Managed AttachedActors - they could be created in your Blueprint from the Construction Script, and you can select and edit their properties from the world, but I’m still a week or so away from releasing it.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/7/d/37da17e5bb5b47bfcd894b13789d930c5cb86a4d.jpeg)
