I’ve encountered this bug a few time already, and I couldn’t find if it has been already reported. Some variables that I’ve just created in a blueprint have their default value equal to zero despite the fact that I’ve set another number in the Details Panel. I had this bug on two floot variables and one int variable already.
As you can see in the pictures, I have a variable that is printed in the begin play event (I can confirm it is not set by another blueprint beforehand) et the print return zero despite having the default value set to 5. The blueprint is compiled, and I’ve tried to build the game and restart UE4.18.0 but the only way to fix this is to delete the variable and make a new one from scratch.
I don’t really know how to reproduce this issue. The first two times with the float variables I thought it was because I duplicated another variable to create them, but this time I believe that I made the int variable from scratch.
I’ll update this post if I find how to reproduce the bug. If you could investigate despite the lack of hints it would be awesome!
We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will follow up.
Okie I think I found a solution to this possible symptom.
My game is on 4.20.3
I am using blueprints, but have some C++ (not sure if this plays into the bug)
I have a parent character blueprint that I’m building a majority of my functionality and default variable values into
When my game starts I spawn in a character which is one of many child blueprints of the main parent blue print
The child blueprint does NOT seem to have the default values that were set in the parent blue print. They were all Zero
The variables that were resetting to zero in the child blueprints had been newly DUPLICATED through the editor and setup with default values after renaming them. (I had been doing this duplicating on the parent blue print, I had NOT been touching the child blueprint at all)
What I discovered when diving into my child blueprint; after I enabled the editor to show Inherited Variables; was that little yellow arrow icon next to the problem variables. For some reason my child blueprint was NOT using the default values.
I clicked the little yellow arrow icon through the entire child blueprint on the inherited values and the problem was fixed!
This issue is still relevant in version 4.24.2. The comment from user ChiggenWingz allows you to solve the problem. I also don’t understand how to reproduce the problem. As mentioned above, it occurs when working with derived classes, and possibly appears when there are a large number of variables in the parent class.