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"

Literal enums are reset after hot reloading

Literal enums are reset in blueprints (at least in animBS) after hot reloading. Everything becomes normal after restarting editor

Product Version: Not Selected
more ▼

asked Dec 27 '14 at 11:34 AM in Bug Reports

avatar image

101 8 12 20

avatar image RAVaught Dec 27 '14 at 04:07 PM

Could you provide an example of what you mean by "reset"? Are they defaulting to 0, or what?

avatar image Tim C ♦♦ STAFF Jan 06 '15 at 07:05 PM

Hi 2rusbekov,

Could you provide some more information about the issue that you are experiencing?

  • What version of the Engine are you using?

  • Are you using the binary version of the Engine installed by the Launcher, or did you build the Engine from source code?

  • Are you able to reproduce this in a new project, or does it only occur in your own project?

  • Can you provide an example of one of the enums that this happens to?

  • What are the exact results that you see?


avatar image Tim C ♦♦ STAFF Feb 26 '15 at 06:44 PM

Hi 2rusbekov,

We have not heard from you for some time. Do you still need help with this issue? I will be marking this issue as resolved for tracking purposes, but if you need any additional help please feel free to re-open this post at any time.


avatar image RogueRocket Jul 10 '15 at 08:24 PM

I guess he's not there, but I'm having this issue, if I'm understanding him right. To be specific, I have a "get" of a variable that is an enum, in animblueprint. I compare it against a constant enum in the blueprint. Most of the time, when I hot reload compiled C++ (where the enum comes from), it will break the BP compile, because the "get" changes from the proper enum, into a byte, and the node linkages to Enum nodes become compile errors.

for example: Error Enum to String must have a valid enum defined Warning Can't connect pins Enumerator and My State : Input is not an Enum. Error The current value (DiveBomb) of the ' B ' pin is invalid: Expected a valid unsigned number for a byte property Error Unexpected node type K2Node_GetEnumeratorNameAsString encountered at Enum to String

avatar image Tim C ♦♦ STAFF Jul 28 '15 at 09:10 PM

Hi RogueRocket,

Sorry for the delayed response. I have a few questions for you.

  • What version of the Engine were you seeing this happen in?

  • Would it be possible to see the code where you are defining your Enum?

  • Was the Enum itself being changed when this happened, or were you hot reloading other changes to your code?


avatar image Tim C ♦♦ STAFF Aug 06 '15 at 08:27 PM

Hi 2rusbekov and RogueRocket,

We have not heard back from either of you for a while. Is this something that you are still needing help with? I will be marking this post as resolved for internal tracking purposes, but if you still need any assistance please feel free to add a comment and re-open this post at any time.


avatar image RogueRocket Aug 17 '15 at 05:57 AM

Sorry i wasn't getting notifications for this for some reason . It is def still happening. Answers to your questions:

Currently on 4.8.3 but was happening as early as 4.7.x

here's code where i'm defining (w/literals changed to make it project generic)

 UENUM(BlueprintType)        //"BlueprintType" is essential to include
 enum class ESomeState : uint8
     Normal         UMETA(DisplayName = "Normal"),
     Grabbing    UMETA(DisplayName = "Grabbing"),
     Kicking        UMETA(DisplayName = "Kicking"),
     Smash        UMETA(DisplayName = "Smash"),
     DiveBomb    UMETA(DisplayName = "Divebomb"),
     Powerup    UMETA(DisplayName = "Powerup")

this happens when hot reloading changes to anything. The observed problem will be that some blueprint will be noted as failing to compile, and it will be because a place where i'm trying to something like "State" == ESomeState[literal]., for example in an animblueprint state transition rule.

Error will be something like: Error The current value (GoalPowerup) of the ' B ' pin is invalid: Expected a valid unsigned number for a byte property

The underlying problem appears to be that somewhere along the way the blueprint variable (in this case an animblueprint) is no longer being displayed as an enum, it is instead, now a Byte.

just verified again, if i close editor and reload it, this problem goes away w/out any other changes.

avatar image Tim C ♦♦ STAFF Aug 25 '15 at 04:00 PM

Thank you for the code showing how you created your enum. I duplicated that enum in the header file for an Actor class, then created the following check in an anim state transition:


Then I went back to the Actor class and added in a new UPROPERTY variable and set the default value in the code constructor and performed a hot reload. When I went back to the Anim Blueprint, the Blueprint did not show any indication of not having compiled successfully, and there were no errors when I looked at the state transition graph. Is the setup I have in the image above similar to how you were using the enum in your state transition graph?


enumcheck.png (40.1 kB)
avatar image RogueRocket Aug 25 '15 at 04:39 PM

it's similar yes. What would appear to happen is that "state" variable would suddenly start getting interpretted as a Byte type rather than enum, and things would get all out of whack.

It doesn't appear to happen every time any more, but it still does occur occasionally. In 4.7.x it happend every time almost, in 4.8.3 it happens occasionally. Either that or whatever extra conditions cause it that I haven't sussed out was occurring more often. I really don't know what is the difference between when it happens and when it does not.

avatar image Tim C ♦♦ STAFF Aug 25 '15 at 07:05 PM

I ran some more tests in both 4.7 and 4.8 with the setup I showed above, as well as with this setup:


I was unable to see a problem where the State variable was interpreted as a Byte instead of as the custom enum. I did see some issues in 4.7 where I was notified that the Blueprint could not be saved after the hot reload. That particular issue is one that I believe was corrected in 4.8 (where it did not occur for me).

When you perform a hot reload, do you generally start a build from inside Visual Studio, or do you click the Compile button in the Editor?


checkenum.png (22.7 kB)
avatar image RogueRocket Aug 25 '15 at 07:27 PM

I personally almost always compile from Visual Studio to Development Editor target. This is not the case for all members of my team, who use the Compile button inside the editor almost exclusively. The problem has occurred in both scenarios.

I will try to take a screenshot the next time we see it.

avatar image Tim C ♦♦ STAFF Sep 10 '15 at 07:32 PM

Hi RogueRocket,

I just wanted to check in and see if you are still seeing this occur.


avatar image RogueRocket Sep 10 '15 at 07:36 PM

We saw it yesterday on one of our projects that is based on 4.9. it's custom compiled engine though so it's somewhat impure test. It's collaborative with another company so I can't say for sure what slice of 4.9 it's branched from, but it's unlikely there were any changes that would be related to this.

We haven't had a recent test case on our main project which is still on 4.8, so i can't say for sure on that one.

avatar image Tim C ♦♦ STAFF Sep 10 '15 at 07:43 PM

I'll keep poking at it here to see if I can reproduce the issue myself.


avatar image casperjeff Sep 16 '15 at 01:01 AM

Almost exact same problem as RougueRocket (also based on custom 4.9 derived engine...very small engine change completely unrelated). Our automated build system seems to have no issues....sometimes engineers get error and recompile the BP and all is fine - but sometimes restart editor to fix.

avatar image Tim C ♦♦ STAFF Sep 25 '15 at 05:37 PM

I still have not been able to reproduce this issue. If you happen to see this happen in a small test project, would you be able to zip it and provide that to us so we can take a look?


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

1 answer: sort voted first

Hi everyone,

I have still not had any luck with reproducing this issue here. There is likely some small detail that I am still missing. I will continue to try to reproduce this periodically, but for now I will mark this as resolved for internal tracking purposes. If you have any additional information that you can provide, no matter how seemingly unimportant, or have a small sample project that reproduces the issue, please feel free to add a comment and re-open the post.


more ▼

answered Oct 02 '15 at 07:16 PM

avatar image Oreganik Oct 30 '15 at 06:24 PM

The issue definitely exists in 4.9.1-0. I found this page through Google by searching for the error message and "ue4 anim bp c++ enum".

It's a pretty crushing "showstopper" of a bug, because it makes the programmer think that the entire anim blueprint is broken.

The issue appears after building in Visual Studio with Unreal open. How many times, or what other things need to be touched to trigger it, is still an open question.

However, the "issue" seems to be resolved by exiting Unreal, rebuilding the DLL, and re-opening Unreal. Suddenly, magically, everything isn't broken anymore.

In case that helps you track down the issue.

avatar image Tim C ♦♦ STAFF Nov 02 '15 at 07:19 PM

Hi Oreganik,

I just gave this another try in 4.10 Preview 3, but still had no luck reproducing the issue. Would it be possible to get a screenshot of how you are using the enum in your Anim BP?


avatar image MacDx Mar 09 '16 at 12:51 AM

Hi, I'm having this same issue right now. I'll post some code and screenshots:

I'm defining this enum our StaticLibrary.h

 enum class ECombatState : uint8
     CS_InCombat UMETA(DisplayName = "Combat"),
     CS_FreeCam UMETA(DisplayName = "FreeCam")

Then I use it here in a blueprint: alt text

After this I make changes to code in the class which my blueprint inherits from. I just added this float:

 UPROPERTY(EditAnywhere,BlueprintReadWrite, Category ="Tunning")
 float sensitivity;

Then hit compile in the editor:

alt text

Then I go to the blueprint and voila:

alt text

Notes: The blueprint I'm using here, inherits from a C++ class that inherits from ACharacter

Edit: I did another test. It looks like this happens when adding or removing UPROPERTY macros. I haven't tried with other macros yet.

byteerror.png (132.2 kB)
byteerror2.png (1.2 MB)
byteerror3.png (223.9 kB)
avatar image Tim C ♦♦ STAFF Mar 22 '16 at 08:27 PM

Hi MacDx,

Which version of the Engine were you using when you saw this error appear. I ran some tests using 4.10.4, and I did not see the same results that you described. I made a new Actor code class and added the enum that you mentioned using. After building the project in Visual Studio, I created a Blueprint from the new Actor class, made a setup similar to what you showed from your Blueprint, and added an instance into the level.

At this point I added the new UPROPERTY value you provided, clicked Compile in the Engine to trigger a hot reload, then went back into the Blueprint. No error was visible in the Blueprint.


(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