# Child blueprint gets parameters reset when changing code in parent

**URL:** <https://forums.unrealengine.com/t/child-blueprint-gets-parameters-reset-when-changing-code-in-parent/262964>\
**Category:** Blueprint\
**Tags:** unreal-engine\
**Created:** [November 27, 2021, 3:56pm UTC](https://forums.unrealengine.com/t/child-blueprint-gets-parameters-reset-when-changing-code-in-parent/262964 "2021-11-27T15:56:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![WhiteRaven\_000](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/whiteraven_000/32/1215068_2.png) [@WhiteRaven\_000](https://forums.unrealengine.com/u/WhiteRaven_000)\
**Post date:** [November 27, 2021, 3:56pm UTC](https://forums.unrealengine.com/t/child-blueprint-gets-parameters-reset-when-changing-code-in-parent/262964/1 "2021-11-27T15:56:11Z")

</div>

Hi,  
I am experiencing a very weird and annoying bug.  
I have a parent blueprint with a lot of functionality (a spaceship). This parent has a child blueprint. Only one for now, but I plan to have dozens when I make many spaceship variants.  
Now, if I change code in the parent blueprint, it _might_ happen that I lose several parameters in the child blueprint, which switch to values which I guess are the presets of each respective component.

Now, I noticed that this bug has been there since the dawn of times:

> **[Topics tagged unreal-engine](https://forums.unrealengine.com/tags/intersection/unreal-engine/question)**
>
> Topics tagged unreal-engine

> [@\[SURVEY\] There's A Really Really Terrible Bug Where Child Blueprints Get Their Variables Reset](https://forums.unrealengine.com/t/survey-theres-a-really-really-terrible-bug-where-child-blueprints-get-their-variables-reset/90578):
>
> Since the dawn of time, or at least the dawn of UE4, there’s been a bug in UE4 which can be extremely damaging when it occurs, and where it occurs it always occurs again. I’ve seen a million answerhub threads about it but haven’t found one on the forums. are some of those answerhub threads: \*\*[Child blueprints not maintaining values set by either parent or itself - Programming & Scripting - Epic Developer Community Forums](https://answers.unrealengine.com/questions/257788/child-blueprints-not-maintaining-values-set-by-eit.html)[Child blueprint class variables reset for some reason - Programming & Sc…](https://answers.unrealengine.com/questions/253875/child-blueprint-class-variables-reset-for-some-rea.html)

I am using now version 4.26.2.  
Is this bug solved in the next version?  
Any plans to solve this bug once and for all?  
Anyone else experience the same with recent UE4 versions?

Thank you!

---

<div class="post-metadata">

**Author:** ![HAF-Blade](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/haf-blade/32/88718_2.png) [@HAF-Blade](https://forums.unrealengine.com/u/HAF-Blade)\
**Post date:** [November 28, 2021, 9:18am UTC](https://forums.unrealengine.com/t/child-blueprint-gets-parameters-reset-when-changing-code-in-parent/262964/2 "2021-11-28T09:18:42Z")

</div>

I’ve got the same issue and I’m using 4.27.

This is quite annoying dangerous because you often don’t recognize it directly, especially when it happens to arrays or gash maps with much data.

I currently tend to use data tables to define these and load the data in the actors constructor, instead of defining it directly as default values.

---

<div class="post-metadata">

**Author:** ![WhiteRaven\_000](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/whiteraven_000/32/1215068_2.png) [@WhiteRaven\_000](https://forums.unrealengine.com/u/WhiteRaven_000)\
**Post date:** [December 4, 2021, 10:41am UTC](https://forums.unrealengine.com/t/child-blueprint-gets-parameters-reset-when-changing-code-in-parent/262964/3 "2021-12-04T10:41:15Z")

</div>

Hi HAF-Blade,  
thanks for the info.  
I set up about one week ago the Source Control, just locally on my hard drive.  
I have to say that I did not experience anymore the “memory loss” on the Blueprint.  
I won’t say it’s fixed, because I cannot exclude it to happen again, but maybe, just maybe, Source Control helps in mitigating this issue.

---

<div class="post-metadata">

**Author:** ![Lemon\_Murder](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lemon\_Murder](https://forums.unrealengine.com/u/Lemon_Murder)\
**Post date:** [July 11, 2023, 2:24am UTC](https://forums.unrealengine.com/t/child-blueprint-gets-parameters-reset-when-changing-code-in-parent/262964/4 "2023-07-11T02:24:11Z")

</div>

I managed to fix it in my project.

I wasn’t able to find the solution anywhere online so hopefully this can help someone in the future who has this problem. So here is what I did:

For reference, my class hierarchy has 3 layers, each inheriting from the previous: Base (1) → Parent (2) → Child (3)  
I had several BPs where this issue was happening. I found it was only happening in Children (or the 3rd layer), and that all of them inherited from the same Parent class. The variable that was being reset was inherited from the Base class, and I realised that the Parent class actually didn’t display the inherited variables from the Base despite having ticked the box “Show inherited variables”. I unticked and re-ticked “show inherited variables” and suddenly the inherited variables were being displayed in the parent. Going back to the child class, the variable was able to successfully compile without resetting to the defaults.

I’ve also had work changing then compiling the default variable of the parent class, then changing that variable back to whatever it was before.

To me, it seems like the variable is resetting because the variables were inheriting properly. I don’t know why this fixed it for me. I don’t know if it’ll fix for anyone else, but this worked for me so maybe it will for you too.

---

<div class="post-metadata">

**Author:** ![novikovvlal](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@novikovvlal](https://forums.unrealengine.com/u/novikovvlal)\
**Post date:** [January 7, 2024, 9:40pm UTC](https://forums.unrealengine.com/t/child-blueprint-gets-parameters-reset-when-changing-code-in-parent/262964/5 "2024-01-07T21:40:28Z")

</div>

This is the right way to fix this issue. But in my case I also had to click revert button near the variables that lost data from parent

---

<div class="post-metadata">

**Author:** ![Drakgoku](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/drakgoku/32/969449_2.png) [@Drakgoku](https://forums.unrealengine.com/u/Drakgoku)\
**Post date:** [March 20, 2024, 9:05pm UTC](https://forums.unrealengine.com/t/child-blueprint-gets-parameters-reset-when-changing-code-in-parent/262964/6 "2024-03-20T21:05:52Z")

</div>

I think I’m late.

If you have this structure  
BP\_Parent

- BP\_Son\_1
- BP\_Child\_n+1

and you modify some variable of the parent, be it name or whatever, then all the children will lose the values of that variable.  
To solve this:

1 - You create a Struct (FSetVariablesFromStruct) with the parameters you need.

In the BP\_Parent  
2 - You create a variable called type VFSetVariablesFromStruct (which will set the necessary variables to the parent) where all the variables that need to be set will do so from the child, they will do so through VFSetVariablesFromStruct.

3 - You can run it in the Construct or in the BeginPlay (I recommend in the Construct so you can see the changes)

Remember that if you rename or compile with any changes the VFSetVariablesFromStruct variable from the parent, all data in the children will be deleted. So try not to touch VFSetVariablesFromStruct or you will delete all the values. Surely UE5 deletes the variable while maintaining some type of reference and then resets it.

Now you can modify all the other variables of the parent, the children will not be affected.
