Custom enums arbitrarily break into bytes in blueprint

I have an enum CharacterState which is critical to my animation blueprint, it consists entirely of arbitrary player states: moving, attacking, jumping, and so forth. I was working in an unrelated blueprint, and suddenly every reference to a CharacterState enum in my project broke. Variables of type CharacterState have changed to byte, and attempts to plug said variables into enum comparison/set nodes tell me that I’m working with a byte, not an enum. I’ve tried rebuilding the project, recompiling, and varying combinations of opening, closing, and restarting visual studio, the blueprint, and UE itself. Is there any way I can fix this, or is my entire project done for?

Edit: This happened again, and I really don’t know what I’m supposed to do- I appear to get 1-2 days of use out of any given enum before it arbitrarily breaks, and the only way I can think of to fix this is “Don’t use enums in blueprint,” which is kind of silly.

Just commenting to my own thread to add that if I cut & paste my enum declaration and give it a new name, I can use it in blueprint, but I don’t really want to change “ECharacterState” to “ECharacterState1” in the 1,000 or so times it occurs in my code.

Hey HInoue-

I was able to reproduce this issue and have submitted a bug report (UE-19528) for further investigation. Though it is a tedious workaround, it is possible to duplicate the enum node in the blueprint and use the duplicate as a replacement to fix the blueprint.

Cheers

Awesome, thanks very much for the reply! Happy it’s a UE4 problem, and not a me problem :slight_smile:

Do you happen to have any idea what triggers it? I can’t get it to happen consistently, but I’ve found that once it does, occasionally force-quitting unreal and restarting it fixes the issue.

I’m getting the same thing. I discovered the “duplicate the node referencing the enum” trick but it’s a pain to do. Seems like changing my C++ code side and reloading sometimes triggers it.

As a faster workaround, I hit RefreshNode on the “bugged” nodes and compile BP!

Same problem happens to me when I hotreload so I tend not to use hotreload anymore when working on this particular BP (containing “bugged” enum).

Problem might be related to creating a BP with an enum (defined in C++ in my case) UPROPERTY and then changing (adding/removing/inserting/renaming?) values in the enum afterwards. Not sure about all the exact causes for this bug but maybe it will help to track it down completely…

My version is: 4.8.2

I had also that kind of warnings when starting the editor so I decided to recreate the “bugged” BP from scratch (and without modifying the enum in C++ anymore)…
LogEnum:Warning: Enum Text OldEnumValue for Enum EMyActorState failed to resolve to any value