# \[4.7\] - Defaults are zeroed out upon BP Construction

**URL:** <https://forums.unrealengine.com/t/4-7-defaults-are-zeroed-out-upon-bp-construction/308152>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [February 26, 2015, 2:24am UTC](https://forums.unrealengine.com/t/4-7-defaults-are-zeroed-out-upon-bp-construction/308152 "2015-02-26T02:24:32Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![MC\_Stryker](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MC\_Stryker](https://forums.unrealengine.com/u/MC_Stryker)\
**Post date:** [February 26, 2015, 2:24am UTC](https://forums.unrealengine.com/t/4-7-defaults-are-zeroed-out-upon-bp-construction/308152/1 "2015-02-26T02:24:32Z")

</div>

Hey Guys,

I am having an issue right now where default values within one of my Blueprints are being zeroed out before Construction Script is being run. I eventually realized that I had to manually click reset button next to each field in any BP that inherited that base class however it is not letting me reset private variables.

What I am having to do is manually uncheck private, reset field, then click private again as a solution. Is there an easier way or is this an issue with BP’s being upgraded to 4.7 where it should be taking inherited default value?

Also, considering its private, shouldn’t parent BP classes not have ability to override default value?

Thanks again!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_20bc299e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_20bc299e](https://forums.unrealengine.com/u/anonymous_user_20bc299e)\
**Post date:** [February 26, 2015, 2:40am UTC](https://forums.unrealengine.com/t/4-7-defaults-are-zeroed-out-upon-bp-construction/308152/2 "2015-02-26T02:40:42Z")

</div>

I am experiencing same bug. If you have a parent class with a float with default value of say 100, and derive a child from it, child’s default will become 0 when you restart editor.

---

<div class="post-metadata">

**Author:** ![MC\_Stryker](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MC\_Stryker](https://forums.unrealengine.com/u/MC_Stryker)\
**Post date:** [February 26, 2015, 2:40am UTC](https://forums.unrealengine.com/t/4-7-defaults-are-zeroed-out-upon-bp-construction/308152/3 "2015-02-26T02:40:43Z")

</div>

Thankfully that trick worked and now my Pawn is working again! But I’m guessing a bug took place when upgrading assets from 4.6.1 to 4.7 and should’ve carried defaults with it.

- My only guess as far as how you could replicate it to look into further is create a new project in 4.6.1 and create a Blueprint w/ Pawn or any Actor as Parent Class.

- Create a variable that can store a default value and set it to some value other than 0 but make it private. Then create another Blueprint that uses that previous BP as it’s parent.

- At that point default should be same or probably not visible since it’s private.

- Go ahead and retarget that project for 4.7 and you should notice that if you uncheck private on first BP, go into second BP you created that is child of first, you will now see it’s set to 0 and likely has reset icon next to it.

Hope this helps and thanks again!

---

<div class="post-metadata">

**Author:** ![MC\_Stryker](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MC\_Stryker](https://forums.unrealengine.com/u/MC_Stryker)\
**Post date:** [February 26, 2015, 2:44am UTC](https://forums.unrealengine.com/t/4-7-defaults-are-zeroed-out-upon-bp-construction/308152/4 "2015-02-26T02:44:03Z")

</div>

I just figured it out, go ahead and uncheck those variables as private, go into child BP that are hiding those defaults and you should see it’s set to 0 but has yellow reset icon next to it. Click that then go back into Parent Blueprint and set it back to Private again and recompile. It’s a little bit of a pain but it does trick 😃

---

<div class="post-metadata">

**Author:** ![MC\_Stryker](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MC\_Stryker](https://forums.unrealengine.com/u/MC_Stryker)\
**Post date:** [February 26, 2015, 4:04am UTC](https://forums.unrealengine.com/t/4-7-defaults-are-zeroed-out-upon-bp-construction/308152/5 "2015-02-26T04:04:09Z")

</div>

For some odd reason, this only works in editor and not in Standalone mode. I am still getting zeroed values and its not changing even after doing trick. I am going to try and clean my build and rebuild it in Visual Studio in hopes that makes difference but now I’m confused. Hopefully that takes care of it but its almost like what is being used in my Standalone Build is not being recompiled. As a note, I got same result from Packaging a build. mystery continues… Ohriginal, if you figure anything out, keep me posted. Appreciate it.

---

<div class="post-metadata">

**Author:** ![CodeSpartan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/codespartan/32/1194561_2.png) [@CodeSpartan](https://forums.unrealengine.com/u/CodeSpartan)\
**Post date:** [March 1, 2015, 7:46pm UTC](https://forums.unrealengine.com/t/4-7-defaults-are-zeroed-out-upon-bp-construction/308152/6 "2015-03-01T19:46:53Z")

</div>

Also experiencing same bug, for both public and private variables of all types. It’s a very nasty issue so hopefully it it will get fixed soon!

Does setting derived bp’s variable to a different vaue than parent bp fix this for you? It fixes it for me, so I just zero parent’s variables however it’s still a very annoying bug.

If someone from Epic is willing to look into this, I can email a project with this bug.

---

<div class="post-metadata">

**Author:** ![redbox](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@redbox](https://forums.unrealengine.com/u/redbox)\
**Post date:** [March 1, 2015, 8:46pm UTC](https://forums.unrealengine.com/t/4-7-defaults-are-zeroed-out-upon-bp-construction/308152/7 "2015-03-01T20:46:33Z")

</div>

Similar issue here.  
I have few booleans in parent BP, and It’s not private.

When editor starts, this booleans set to “True” in parent BP by default. It’s ok.  
But all childs have this set to “False”.

If change value in parent BP from “True” to “False”, and vise versa, and recompile parent BP, all childs get this parameters with last saved in parent (in this case - “True”)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_33800a51](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_33800a51](https://forums.unrealengine.com/u/anonymous_user_33800a51)\
**Post date:** [March 1, 2015, 8:57pm UTC](https://forums.unrealengine.com/t/4-7-defaults-are-zeroed-out-upon-bp-construction/308152/8 "2015-03-01T20:57:53Z")

</div>

Hi all,

This issue has been assigned to a member of our staff who will begun looking into it as soon as possible. Thanks for your patience!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_33800a51](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_33800a51](https://forums.unrealengine.com/u/anonymous_user_33800a51)\
**Post date:** [March 1, 2015, 8:58pm UTC](https://forums.unrealengine.com/t/4-7-defaults-are-zeroed-out-upon-bp-construction/308152/9 "2015-03-01T20:58:40Z")

</div>

Hi CodeSpartan,

If you’re able to put together a small test project for us, that would be great! Just put it somewhere online and let us know download link. Thanks!

---

<div class="post-metadata">

**Author:** ![CodeSpartan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/codespartan/32/1194561_2.png) [@CodeSpartan](https://forums.unrealengine.com/u/CodeSpartan)\
**Post date:** [March 1, 2015, 10:31pm UTC](https://forums.unrealengine.com/t/4-7-defaults-are-zeroed-out-upon-bp-construction/308152/10 "2015-03-01T22:31:47Z")

</div>

Hello,

I’ve managed to narrow it down to what seems to be a circular dependency issue.

To reproduce:

1. create a MyCharacter blueprint, add an int variable and set its default value

2. create a MyCharacter\_Child blueprint, based on first blueprint

3. create an UMG widget with a button that when clicked, gets player character and tries to cast it to MyCharacter\_Child

4. in MyCharacter blueprint, create that widget in BeginPlay

5. close project and reopen (you don’t even have to click play) - default value of int variable will be reset to 0 on child bp

---

<div class="post-metadata">

**Author:** ![MC\_Stryker](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MC\_Stryker](https://forums.unrealengine.com/u/MC_Stryker)\
**Post date:** [March 1, 2015, 11:40pm UTC](https://forums.unrealengine.com/t/4-7-defaults-are-zeroed-out-upon-bp-construction/308152/11 "2015-03-01T23:40:55Z")

</div>

Thanks for update, looking forward to fix! Hey CodeSpartan and , does this happen to you guys only in Standalone Mode? I had this happen but what I had to do was to uncheck Private and manually set default in any BP that inherited that base that contained those variables. This worked in editor but still doesn’t reflect in Standalone Mode, Launch or packaging a Staging Build.

---

<div class="post-metadata">

**Author:** ![CodeSpartan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/codespartan/32/1194561_2.png) [@CodeSpartan](https://forums.unrealengine.com/u/CodeSpartan)\
**Post date:** [March 1, 2015, 11:50pm UTC](https://forums.unrealengine.com/t/4-7-defaults-are-zeroed-out-upon-bp-construction/308152/12 "2015-03-01T23:50:05Z")

</div>

This happens for me for both public and private variables so I didn’t try workaround.

---

<div class="post-metadata">

**Author:** ![MC\_Stryker](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MC\_Stryker](https://forums.unrealengine.com/u/MC_Stryker)\
**Post date:** [March 1, 2015, 11:56pm UTC](https://forums.unrealengine.com/t/4-7-defaults-are-zeroed-out-upon-bp-construction/308152/13 "2015-03-01T23:56:46Z")

</div>

Interesting. It definitely is some issue with inheritance. In your example above with MyCharacter\_Child, if you look at values of those variables there that come from base class in child class, do defaults in child BP have your original defaults or are you seeing a 0 in there?

---

<div class="post-metadata">

**Author:** ![CodeSpartan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/codespartan/32/1194561_2.png) [@CodeSpartan](https://forums.unrealengine.com/u/CodeSpartan)\
**Post date:** [March 2, 2015, 12:19am UTC](https://forums.unrealengine.com/t/4-7-defaults-are-zeroed-out-upon-bp-construction/308152/14 "2015-03-02T00:19:41Z")

</div>

If I leave defaults unchanged, they are zeroed to 0 after editor restart and yellow arrow appears. For example if in parent I set variable’s default value to 200, and save both blueprints, child’s default value of that variable becomes 200 as it should, but only until editor restart.

---

<div class="post-metadata">

**Author:** ![MC\_Stryker](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MC\_Stryker](https://forums.unrealengine.com/u/MC_Stryker)\
**Post date:** [March 2, 2015, 3:05am UTC](https://forums.unrealengine.com/t/4-7-defaults-are-zeroed-out-upon-bp-construction/308152/15 "2015-03-02T03:05:54Z")

</div>

Gotcha, well I’m hoping issue gets patched for next hotfix. Let us know if there is anything additional you need us to test. Thanks!

---

<div class="post-metadata">

**Author:** ![Slavq](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Slavq](https://forums.unrealengine.com/u/Slavq)\
**Post date:** [March 2, 2015, 9:05pm UTC](https://forums.unrealengine.com/t/4-7-defaults-are-zeroed-out-upon-bp-construction/308152/16 "2015-03-02T21:05:52Z")

</div>

I have same problem, also looks like this: [Problem with default values of variables being reseted - Programming & Scripting - Epic Developer Community Forums](https://answers.unrealengine.com/questions/179108/problem-with-default-values-of-variables-being-res.html)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_33800a51](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_33800a51](https://forums.unrealengine.com/u/anonymous_user_33800a51)\
**Post date:** [March 4, 2015, 1:50am UTC](https://forums.unrealengine.com/t/4-7-defaults-are-zeroed-out-upon-bp-construction/308152/17 "2015-03-04T01:50:26Z")

</div>

Hi all,

We believe this is related to issue reported here:

> **[Floats read 0 in 4.7](https://forums.unrealengine.com/questions/177658/floats-read-0-in-47.html)**
>
> I just ported my project from 4.6 to 4.7 and literally 99% of everything I’ve added in blueprints in the entire game doesn’t work at all. It either doesn’t show up or has a crazy effect. My zoom fov is zooming into a single pixel point. My sprint...

which states:

> This was caused by default values for  
> inherited values being initialized to  
> zero, rather than values in their  
> ‘super’ blueprint. For instance, lets  
> say I have two blueprints: BP\_Super,  
> and BP\_Child. with BP\_Child being  
> based on BP\_Super. Values in BP\_Child  
> could show up as 0, even if they were  
> set to something non-zero in BP\_Super.

Thanks for pointing that out, Slavq! There is a GitHub pull request located here that should resolve issue for you, that will be included in 4.7.3 release:

[https://github.com/EpicGames/UnrealEngine/commit/5b06ef7cd541deb6dc0c57fc7ed19868ba7a1916](https://github.com/EpicGames/UnrealEngine/commit/5b06ef7cd541deb6dc0c57fc7ed19868ba7a1916)

Thanks for reports, everyone!

---

<div class="post-metadata">

**Author:** ![MC\_Stryker](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MC\_Stryker](https://forums.unrealengine.com/u/MC_Stryker)\
**Post date:** [March 4, 2015, 3:06am UTC](https://forums.unrealengine.com/t/4-7-defaults-are-zeroed-out-upon-bp-construction/308152/18 "2015-03-04T03:06:48Z")

</div>

Thanks for update!

---

<div class="post-metadata">

**Author:** ![CodeSpartan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/codespartan/32/1194561_2.png) [@CodeSpartan](https://forums.unrealengine.com/u/CodeSpartan)\
**Post date:** [March 4, 2015, 5:28am UTC](https://forums.unrealengine.com/t/4-7-defaults-are-zeroed-out-upon-bp-construction/308152/19 "2015-03-04T05:28:27Z")

</div>

Guys, don’t try to add those changes manually, let’s wait for 4.7.3. I tried to add them and rebuilt engine and it broke custom enums in my project (I have version control so it’s ok)

---

<div class="post-metadata">

**Author:** ![MC\_Stryker](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MC\_Stryker](https://forums.unrealengine.com/u/MC_Stryker)\
**Post date:** [March 4, 2015, 7:12am UTC](https://forums.unrealengine.com/t/4-7-defaults-are-zeroed-out-upon-bp-construction/308152/20 "2015-03-04T07:12:48Z")

</div>

Thanks for heads up CodeSpartan and glad to hear you had a backup.

[Next page](https://forums.unrealengine.com/t/4-7-defaults-are-zeroed-out-upon-bp-construction/308152.md?page=2)
