# Inherited variables from parent class keeps reseting in Child BP

**URL:** <https://forums.unrealengine.com/t/inherited-variables-from-parent-class-keeps-reseting-in-child-bp/361616>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [June 21, 2016, 9:15pm UTC](https://forums.unrealengine.com/t/inherited-variables-from-parent-class-keeps-reseting-in-child-bp/361616 "2016-06-21T21:15:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![D2liriuM](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@D2liriuM](https://forums.unrealengine.com/u/D2liriuM)\
**Post date:** [June 21, 2016, 9:15pm UTC](https://forums.unrealengine.com/t/inherited-variables-from-parent-class-keeps-reseting-in-child-bp/361616/1 "2016-06-21T21:15:47Z")

</div>

The inherited variables from parent class, that were set in the child blueprints randomly resets to default values (the one in the parent BP).

Engine version is 4.12.3

Any variable types seem to be affected, from integer to structs, everything gets reseted.

I don’t know this exactly happens.

It happened both, with class that were in the level, and with ones that only were in the content browser.

Not all child Bp resets at once.

Any help is appreciated, i will start setting all the variables in the construct scrypt now.

Sorry for the bad english.

---

<div class="post-metadata">

**Author:** ![TJ\_V](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tj_v/32/1008648_2.png) [@TJ\_V](https://forums.unrealengine.com/u/TJ_V)\
**Post date:** [June 22, 2016, 7:40pm UTC](https://forums.unrealengine.com/t/inherited-variables-from-parent-class-keeps-reseting-in-child-bp/361616/2 "2016-06-22T19:40:11Z")

</div>

Hi D2liriuM,

I did some digging and we have had reports from other users fixing this by restructuring content (being mindful of cyclical dependencies). Here is some advise by one of our developers on how to do this:

> The general suggestions we make to  
> clean up dependencies are usually to  
> use interfaces and event-dispatchers.  
> Using dispatchers usually makes your  
> dependencies one way, and interfaces  
> let you obfuscate dependencies on a  
> Blueprint that may bring in a handful  
> of unrelated dependencies.

If you still can’t fix the issue, we will need some more info. What exactly are you doing when the variables reset? Do you have a small test project or a stripped down version of the project that has the issue?

---

<div class="post-metadata">

**Author:** ![D2liriuM](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@D2liriuM](https://forums.unrealengine.com/u/D2liriuM)\
**Post date:** [June 23, 2016, 4:46pm UTC](https://forums.unrealengine.com/t/inherited-variables-from-parent-class-keeps-reseting-in-child-bp/361616/3 "2016-06-23T16:46:20Z")

</div>

The problem happens like this:

I have a blueprint called spell (Actor Bp). In this blueprints i have some functions and variables defined. As a child, i have “buffs”. This buff bp has some extra variables and functions . Whenever i want to create a new spell or buff, i make a child of one of these. And i set the variables in this child acording to what is needed and also some events.

This child’s variables,gets reseted back to deafult sometimes, i really don’t know when.

One thing i could do to solve this, is create a big struct and move all variables there. Then i would use datatables to save the variables, but i am not sure if it is a good idea, cuz the struct will contain a lot, like 50 variables or so.

The other thing is using the construct scrypt to set all the variables instead of the variable’s tab in the editor.

What would be best?.

---

<div class="post-metadata">

**Author:** ![TJ\_V](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tj_v/32/1008648_2.png) [@TJ\_V](https://forums.unrealengine.com/u/TJ_V)\
**Post date:** [June 23, 2016, 5:51pm UTC](https://forums.unrealengine.com/t/inherited-variables-from-parent-class-keeps-reseting-in-child-bp/361616/4 "2016-06-23T17:51:50Z")

</div>

I think setting the variables in the construction script is the way to go. Having structs of that size can sometimes just be asking for trouble down the road.
