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"

Adding to existing C++ Enum does not update blueprints using the enum.

I created a C++ character class which uses a custom C++ Enumeration in a variable called CharacterState:

alt text

Referencing this variable in my blueprint works as expected.

BUT when I go to add a new value to my enumeration the blueprint does not behave as excepted. I added a new variable to the ECharacterState enum: Flying

alt text

After compiling the code I do not see the new enumeration in the blueprint code:

alt text

The first thing that is wrong, is that the Enum did not get recompiled. A work around for this is to declare a temporary variable in the header file (of the enum type):

alt text

This forces the enum to be recompiled.

The Flying value still does not show in the Blueprint. The only way to make it work is to add a new Character State getter node, and create a new equality operator.

alt text

The top line of code has the new Flying enum value, but the bottom line does not.

This is a serious problem. If you ever change an enumeration after it has already been used in Blueprints, you would have to update every single place using that enumeration. What can I do to fix this?

Product Version: UE 4.15
capture.png (26.0 kB)
capture3.png (3.8 kB)
capture4.png (16.1 kB)
capture5.png (2.9 kB)
capture6.png (28.7 kB)
more ▼

asked Mar 02 '17 at 12:47 AM in Bug Reports

avatar image

24 1 4 5

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

1 answer: sort voted first

Workaround for changing C++ enumerations:

1) Close the editor.

2) Make the enum change in your IDE (Add, Remove, Rename or Reorder)

3) Delete the Binaries folder in your project.

4) Recompile the project through the IDE.

5) Reopen the editor and everything will be alright.

more ▼

answered Mar 02 '17 at 01:37 AM

avatar image

24 1 4 5

avatar image Tim C ♦♦ STAFF Mar 16 '17 at 03:25 PM

Hi CanadianGuy43,

This is a known issue that we are already aware of (UE-22059). Your workaround is fine, but step 3 is not strictly necessary. Simply performing a standard, non-hot reload compile in Visual Studio with the Editor closed should provide the updated enum to the Editor when the project is opened again.


avatar image Cirralisis May 25 '17 at 04:41 AM

Hey Tim, this seems to have been a bug for a couple years now. I haven't been able to find much about the root causes of the issue and just wondering if you know anything you can share with us?


avatar image Blindopoly Jun 22 '19 at 05:46 AM

I'm still seeing this issue on 4.22. But this workaround still works.

(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