Enum values not updating until editor restart

Hi,

I think I’ve found bug in 4.9.2. Changes mede to UENUM are not getting reflected in editor until restart:

repro:

  1. Create blank C++ project out of “blank” template.

  2. Fire VS and go to [projectName]GameMode.h file.

  3. Add this code before class definition:

    UENUM(BlueprintType) //“BlueprintType” is essential to include
    enum class EUnitStatistic : uint8
    {
    HEALTH UMETA(DisplayName = “Health”),
    ACTION_POINTS UMETA(DisplayName = “ActionPoints”),
    };

  4. Recompile and Hot Reload

  5. Go to editor, create empty blueprint class, inherit it from actor

  6. Open this blueprint, add local variable of type EUnitStatistic. Note that it has two values “Health” and “ActionPoint”. Up til now everything is ok.

  7. Update enum by adding new statistic:

    aaaa UMETA(DisplayName = “aaaa”),

  8. Compile, hot reload

  9. Go to editor and exammine variable created in point 6. Try to change its value to aaaa. The variable is not present. Error.

  10. Restart editor. Now value is present.

P.S. My newlines after each point somehow (again) are disappearing.

cheers

Unfortunately this still happens in 4.10. Admittedly I didn’t follow these steps, but I’ve had the same problem in my project. I guess I just have to rebuild the editor, and go and make tea while I wait… :frowning:

I’ve stopped using enums at all. They are just broken. This is not the only problem with them. In 4.9.2 (under which I am working now) it happens that after You reopen editor all enum values change their type from enum to byte which causes blueprints to not compile.

Hello ,

That particular issue you mention with the type being changed to byte has been reportedly fixed in 4.10. As for your original issue, I’ll look into that and see what I can find.

Thats good news. Great!

It appears that there is a bug report in for Enum entries not updating on Hot Reload as well, although it has not been fixed as of yet. I’ll update the community interest on the bug so that maybe it’ll be fixed sooner rather than later but I cannot make any guarantees. For your reference, the bug number is UE-22059, in case you need to ask for updates.

This issue still seems to be here in 4.12 FYI.

That is correct. It’s still marked as To Do at this point and has not been fixed.

The issue still persists 4.17…
Just restarting the editor once doesn’t always solve it either.

also it doesn’t just not show up, the entire enum breaks, and I have to reassign variables to be of that enum type.

Issue still exists in 4.18.3.

Appears to still be an issue in 4.19 Preview 4

4.20 reporting in! Needed to restart the error to fix it. Blueprint using the enum wouldn’t compile until I fixed all the nodes cause it “remembered” how the enum was until added new entries. 4.21.1 is out currently but haven’t migrated to it.

4.21 the issue still present. Having enum with 50+ entries requires to reconnect all nodes when adding 1 new entry and recompiling. FUntastic waste of everybody’s time, EPIC.