Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

All user-defined variables repeatedly reset to zero

All of the user-defined variables in my Character blueprint are being repeatedly reset to zero. I've fixed the values again and again, but they keep resetting to zero. This happened one day when I editing my HUD blueprint. Suddenly I couldn't move because the "CanMove" variable in my Character blueprint was set to false.

Product Version: Not Selected
more ▼

asked Sep 08 '14 at 02:50 AM in Bug Reports

avatar image

26 3 6 20

avatar image xrouter Sep 08 '14 at 11:30 AM

I've had this issue as well. All my Blueprints that were trigger boxes with public variables got reset to default value.

I can't replicate this all the time, seems to be something that happens infrequently.

avatar image Doug E ♦♦ STAFF Sep 08 '14 at 02:14 PM

Hey eglynum-

At what point are the variables being reset to default? Is it when you close the blueprint or when you play in editor or at other times? Also, what are the variables supposed to control in the character blueprint? Keep in mind it's always best to recompile after any changes made to your blueprints.


Doug Wilson

avatar image eglynum Sep 08 '14 at 03:25 PM

I'm not exactly sure when it happens. Opening and closing the blueprint or playing the game doesn't trigger it. I think Unreal has to be closed and reopened before it happens. I always save and compile after i fix the zeros. Here's a picture of the variables that get reset. Some are set at run-time, but the one's that aren't (like MaxHealth and BaseTurnRate) are the problem. variables that get reset to zero

unreal.png (94.6 kB)
avatar image Doug E ♦♦ STAFF Sep 08 '14 at 03:49 PM

Which template did you base your game on (first person, third person, code, etc.)? Also, which version of the engine are you working in and would it be possible to show where these values are being set?

avatar image eglynum Sep 08 '14 at 05:43 PM

We started with the first-person template. We are using Unreal 4.4.1. And the values are initially being set in the Defaults tab of the CharacterObie blueprint. After that they are modified at run-time by various blueprints (mostly within CharacterObie, but sometimes from other blueprints - CanFire for example is modified by an animation blueprint. Maybe it could help to mention that CharacterObie serves as the base blueprint for other derived blueprints.

avatar image Doug E ♦♦ STAFF Sep 08 '14 at 08:32 PM

I am still trying to find the cause of this issue. As xrouter pointed out, are the variables you're using set to public or private? Also, what did you change in your HUD blueprint prior to when this bug started happening? Could you please supply screenshots of your HUD blueprint (what had changed).

avatar image eglynum Sep 08 '14 at 08:34 PM

"Team" is public. The rest are private. A lot of things changed in HUDObie. Here's a couple of screenshots for before and after. I apologize that it's too small to read, it's really just to show you how much changed. Most of it is gathering info about the player and calling "Draw Text", "Draw Texture", or "Draw Material". Info about the player is being gathered by getting the owning player controller -> controlled pawn -> cast to CharacterObie -> get info. The "AFTER" version also has some ray casting to see if it's aiming at an enemy. alt text

unreal.png (364.0 kB)
avatar image Doug E ♦♦ STAFF Sep 08 '14 at 08:54 PM

After manually resetting the values and playing the game in editor do the values reset when you stop playing? Is it something you only see when you open the project? Does the bug occur on a clean project that you add a variable to? I apologize for the barrage of questions, just trying to gather as much information on what is happening as possible. Also if you could post a screenshot of your HUD blueprint to see if something in there is causing the problem.

avatar image eglynum Sep 08 '14 at 09:14 PM

After manually resetting and playing the game in editor the values do not reset. Yes, it only happens when I open the project (and it happens every time I open the project). I've only work in this project, so I'm not sure if I could make it happen on a clean project. I thought of a couple other things that may be of interest. We use perforce with Unreal and there are frequently many files that Unreal wants to check-out and save that seem to have nothing to do with what I've been working on (like if I change the CharacterObie blueprint and it wants to save all the blueprints that derive from it), so I leave them locked and unsaved. Also, this project was created using Unreal 4.2 and it's been upgraded through every version since.

Did you post the comment about wanting a screenshot of the HUD blueprint before I edited my previous post, or did you want a series of close-up shots to see all the details?

avatar image Doug E ♦♦ STAFF Sep 08 '14 at 09:28 PM

I had asked for the screenshots before you had edited, I can try working with those that you posted for the time being.

As for perforce wanting to save excess files, that is a known issue that is being investigated and will have a fix included in a future update.

For the variable defaults issue could you try to reproduce that in a fresh project. If so that would give us a place to start looking for the cause of the problem.

avatar image eglynum Sep 08 '14 at 09:40 PM

This issue didn't show up for 2-3 months into development, and when it finally did, it happened unexpectedly. I don't know what I'd do after creating a clean project to reproduce it, so I'm gonna pass on that for now. If you need any more info let me know.

avatar image Doug E ♦♦ STAFF Sep 09 '14 at 01:39 PM

Based on what we've discussed it sounds like some relation between your character blueprint and your HUD blueprint. Could you create a new project and migrate those files into it?

avatar image eglynum Sep 09 '14 at 03:48 PM

I created a new project based off of the "First Person Blueprint" template and migrated one of my characters (which included CharacterObie, HUDObie, and tons of other things). The zeroing issue seems to be gone. So now I'm wondering what's the easiest way to migrate my entire project?

I had another thought while doing this. We started this project using the "First Person Code" project, then we decided to convert everything that was code to blueprints (code was to be used sparingly). Any thoughts?

avatar image Doug E ♦♦ STAFF Sep 09 '14 at 03:54 PM

While I don't believe the strict process of converting from code to blueprint would cause the problem, it is possible that a reference somewhere was disassociated during the switch. If you are able to migrate your project over to the new one feel free to respond to this thread if the issue with variables resetting to zero shows up again. I would suggest saving and testing each part that is migrated to try and catch the portion of the project causing the problem.


Doug Wilson

avatar image eglynum Sep 09 '14 at 05:32 PM

I was wrong... after the migration, the zeroing problem is still there. We had something in the construction script that hid the problem, but it's definite still happening.

avatar image Doug E ♦♦ STAFF Sep 09 '14 at 05:43 PM

So it sounds like the issue is being caused by one of the blueprints. To further investigate what is happening I would need to see your blueprint, preferably the one you migrated in that still had the problem. It would also help if you could point out the part of the construction script that was masking the problem after migrating.

avatar image eglynum Sep 09 '14 at 06:12 PM

It looks like that's going to be about 12 pictures. Is there a better way for me to get it to you? Also, there were a total of 13 blueprints migrated because of dependencies. If you need to look at those, getting pictures might be tedious.

avatar image Doug E ♦♦ STAFF Sep 09 '14 at 06:36 PM

It would probably be best if you could zip the blueprints and attach them.

avatar image eglynum Sep 09 '14 at 08:28 PM

The blueprints are attached. The one that gets zeroed is CharacterObie. It is the base blueprint for CharacterG. Also, I should note that this issue appeared first after a change to HUDObie. link text

avatar image Doug E ♦♦ STAFF Sep 09 '14 at 08:50 PM

Thank you for the blueprints. What was the exact change made to HUDObie before the issue appeared or is it any change to HUDObie that causes it to happen?

avatar image xrouter Sep 13 '14 at 02:40 PM

Has there been a resolution on this?

I'm still suffering the issue as well. Here is my very simple BP:

alt text

Essentially it calls an interface with the text in the default variable. I place a load of these in the level and set them to all the value I need the characters who walk over them to say.

I can't get it to reset on demand despite spending an hour trying to figure out what causing it but just every now and again when I open my project all the instances in the project will be reset back to the default value.

I've tried altering the BP ->quitting/starting, packaging ->quitting/starting.Rebuilding the interface etc etc It doesn't seem to follow any logical path that I can discover.

I can't use the suggested fix of setting the value on construction as there are lots of instance of this

varreset.png (2.1 MB)
avatar image Doug E ♦♦ STAFF Sep 16 '14 at 02:26 PM

Hey xrouter-

Do you have a function in your blueprint that tries to interact with your HUD in any way?

avatar image xrouter Sep 16 '14 at 03:44 PM

Not directly no, the above is the only functionality in that BP. I do display the text to the HUD but that is done by another separate BP which pulls the text out of a user structure. The interface function I'm calling in the above BP simply sets that user structure.

avatar image Doug E ♦♦ STAFF Sep 16 '14 at 04:22 PM

To get the trigger volume to reset you will need to plug something into the Reset input of your Do Once node. If that action happens it will allow the volume to be triggered again. As for the variable values resetting to zero, the fix for eglynum was to remove a function that was accessing the HUD from a blueprint before an instance of that blueprint existed. You may want to check when and where your blueprint tries to access or draw to the HUD.

avatar image xrouter Sep 16 '14 at 05:00 PM

Ok I'll check the chain for the HUD draws.

When I said 'Reset' I was referring to my attempts to see what was triggering the variable resetting to its default value rather than getting the do once to reset (sorry if that was confusing)

avatar image eglynum Sep 09 '14 at 09:04 PM

HUDObie doesn't seem to be causing the problem. If I remove the logic from it, the problem still happens. But the changes that took place are shown (at a distance) in one of my posts above with the before and after shot. The changes involved adding a minimap to the HUD and changing the reticle so it turned red when you looked at an enemy.

avatar image Midnight640 Jun 08 '15 at 12:13 PM

My project started resting its variables out of the blue. (4.7.6) Right now only resets to zero some booleans and integers.

I have an array (50) of custom structures(18 values (3d meshes audio files , damage stats names etc) in a save object. I I try to change them the editor crashes sometimes and refuses to pack the game after that and I have to restore the WHOLE project folder not just content and confing..

avatar image Doug E ♦♦ STAFF Jun 08 '15 at 02:47 PM

Hey Midnight640-

If the problem that you're having is causing a crash you may want to create a separate post. If so can you provide some more information about what's happening in your project. Are the variables that are being reset inside of blueprints? Are they specific to certain instances in the level? Additionally, if you are getting a crash can you post the callstack and log file to help identify where the crash is occurring.


Doug Wilson

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Seeing as you are trying to set the values in the defaults tab you may want to remove where you have them being set inside the construction script. Any actions inside the construction script will be run each time an instance of that blueprint is placed in the level or edited within the level (moved, scaled, rotated, etc.) Alternatively, the values set in the construction script will override the default values when the game starts (if the blueprint asset is already in the level) or when the asset is created. As such you may be able to leave the values as they are in the defaults tab if you are manually setting them in the construction script.

more ▼

answered Sep 09 '14 at 09:28 PM

avatar image eglynum Sep 09 '14 at 10:14 PM

The default values are being set in the construction script as a temporary solution to the zeroing issue. It will be removed when the user-defined values stop being forced to zero every time Unreal restarts.

avatar image Doug E ♦♦ STAFF Sep 10 '14 at 02:26 PM

I receive an error when I compile the CharacterObie blueprint stating that the ShowHUD function has no target. That aside I do not see the values reset to zero when I close and reopen the editor. Would you be able to migrate each blueprint into a project one at a time and let me know which one was the last one imported before the problem happens?

avatar image eglynum Sep 10 '14 at 03:45 PM

You got it! The zeroing issue went away after I removed the ShowHUD function. Potentially, I was accessing the "ShowHUD" variable in HUDObie from CharacterObie before the HUDObie actor existed. The user-defined variables may have been consistently placed in memory where "ShowHUD" was trying to be accessed. Thanks!

avatar image Mattboyguy May 01 '15 at 04:55 AM

Big thanks to this thread. I had a semi related problem and it was solved via doug/eglynum's first comment about the construction script tab.

avatar image Tulrath May 04 '15 at 05:27 PM

I'm seeing this issue appear again in 4.7.6. Default values for Integers keep getting reset to 0 when Unreal starts. I have no errors in my output log.

avatar image Doug E ♦♦ STAFF May 04 '15 at 06:02 PM

Hey Tulrath-

Where are you seeing the values resetting to 0? Is this happening inside blueprints or elsewhere? If this is happening in blueprints are any of them based on custom code classes you've created? Please let me know if there's any additional information you can provide to help narrow down where this is occurring.


Doug Wilson

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question