# (Blueprint) User defined enum in 4.9 getting corrupted

**URL:** <https://forums.unrealengine.com/t/blueprint-user-defined-enum-in-4-9-getting-corrupted/328211>\
**Category:** Blueprint\
**Tags:** ENUM, unreal-engine, bug-report, Blueprint, question\
**Created:** [August 10, 2015, 2:42pm UTC](https://forums.unrealengine.com/t/blueprint-user-defined-enum-in-4-9-getting-corrupted/328211 "2015-08-10T14:42:35Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_a1d09d07](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_a1d09d07](https://forums.unrealengine.com/u/anonymous_user_a1d09d07)\
**Post date:** [August 10, 2015, 2:42pm UTC](https://forums.unrealengine.com/t/blueprint-user-defined-enum-in-4-9-getting-corrupted/328211/1 "2015-08-10T14:42:35Z")

</div>

I believe there is a severe underlying issue in 4.9 regarding user defined enums in blueprint. I had posted a previous bug report ([Local variable crash in 4.9 - Programming & Scripting - Epic Developer Community Forums](https://answers.unrealengine.com/questions/275247/local-variable-crash-in-49.html)) about a user defined struct that contained a user defined enum causing crashes in the editor, and now I have found that in 4.9 my enums are actually getting corrupted.

**In 4.9p2** :

- Create a new Blueprint Enum, named whatever
- In that enum add three entries titled, “First”, “Second”, and “Last”
- Create a new Agent based Blueprint
- In that new blueprint, add an editable variable that contains the new enum
- In the Event Graph for that agent, add a simple print of the enum variable’s value to the Begin Play event
- Add that blueprint actor to an empty level
- **Note** in 4.9 the default value of the enum appears to be None whereas in 4.8 it is the first value
- Set the actor’s enum value to “First”
- Run the game
- **Note** In 4.9p2 this test consistently printed out the enum having a value of “Second” despite it being set to “First”.

**In 4.8.2** :

- Repeat the steps above, but note that in 4.8 the enum value in the actor defaults to the “First” entry
- Note also that the enum prints out the proper value of “First” when you play the game

---

<div class="post-metadata">

**Author:** ![TJ\_V](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tj_v/32/1008648_2.png) [@TJ\_V](https://forums.unrealengine.com/u/TJ_V)\
**Post date:** [August 10, 2015, 8:08pm UTC](https://forums.unrealengine.com/t/blueprint-user-defined-enum-in-4-9-getting-corrupted/328211/2 "2015-08-10T20:08:43Z")

</div>

Hi John,

Thank you for the report. I was able to reproduce the issue in the 4.9 Preview 2 version, so I’ve entered it as JIRA UE-19849 in our trafcking software. The developers will be investigating it further and we will post here with updates as we have them.

Cheers,

TJ

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_a1d09d07](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_a1d09d07](https://forums.unrealengine.com/u/anonymous_user_a1d09d07)\
**Post date:** [August 11, 2015, 7:44pm UTC](https://forums.unrealengine.com/t/blueprint-user-defined-enum-in-4-9-getting-corrupted/328211/3 "2015-08-11T19:44:39Z")

</div>

Hi TJ

I see the issue in the 4.9 preview “Known Issues” list as: “UE-19849 Enum Variable doesn’t pull the correct Default Value” and I just wanted to verify that you have reproduced and are aware that the issue is more than just the default value, but rather any value that is set is not retrieved properly.

---

<div class="post-metadata">

**Author:** ![TJ\_V](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tj_v/32/1008648_2.png) [@TJ\_V](https://forums.unrealengine.com/u/TJ_V)\
**Post date:** [August 11, 2015, 8:05pm UTC](https://forums.unrealengine.com/t/blueprint-user-defined-enum-in-4-9-getting-corrupted/328211/4 "2015-08-11T20:05:54Z")

</div>

Yeah, I have it in the description and the repro steps for the JIRA that it is referring to the ‘Default Value’ that you set in the variable. Any value set there is not pulled properly.

---

<div class="post-metadata">

**Author:** ![Invius](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Invius](https://forums.unrealengine.com/u/Invius)\
**Post date:** [September 3, 2015, 1:33am UTC](https://forums.unrealengine.com/t/blueprint-user-defined-enum-in-4-9-getting-corrupted/328211/5 "2015-09-03T01:33:54Z")

</div>

I am getting the same problem with enums, in the version 4.9.0:

 ![56897-untitled.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/8/8/f88544cec4948704a9286614ac61830b9b442145.jpeg)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_a1d09d07](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_a1d09d07](https://forums.unrealengine.com/u/anonymous_user_a1d09d07)\
**Post date:** [September 3, 2015, 1:48am UTC](https://forums.unrealengine.com/t/blueprint-user-defined-enum-in-4-9-getting-corrupted/328211/6 "2015-09-03T01:48:03Z")

</div>

Ack that isn’t good, especially since this bug was called out as being fixed in Preview 4. I never got around to testing it though ☹ Hopefully a hotfix will address this fast because this is a pretty critical bug.

---

<div class="post-metadata">

**Author:** ![Invius](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Invius](https://forums.unrealengine.com/u/Invius)\
**Post date:** [September 3, 2015, 2:14am UTC](https://forums.unrealengine.com/t/blueprint-user-defined-enum-in-4-9-getting-corrupted/328211/7 "2015-09-03T02:14:49Z")

</div>

I hope it too, because the version 4.9 came with some interesting improvements on AI.

---

<div class="post-metadata">

**Author:** ![jtsmith](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jtsmith](https://forums.unrealengine.com/u/jtsmith)\
**Post date:** [September 3, 2015, 2:27am UTC](https://forums.unrealengine.com/t/blueprint-user-defined-enum-in-4-9-getting-corrupted/328211/8 "2015-09-03T02:27:53Z")

</div>

This has been reported a lot lately. Ben Halliday (Staff) has been tracking the complaints here recently, says he has filed another bug report and when I posted my issue he referred me to this link as he will update that answer as he gets more details:

> **[Integer to enum(byte) with strange casting result](https://forums.unrealengine.com/questions/294613/integer-to-enumbyte-with-strange-casting-result.html)**
>
> Hi, Just updated to UE 4.9 and I have a problem with casting int to byte & enum in bp. TL;DR version: casting 0,1,2(int) to enum failed, and results of casting enum to int are 2,4,6(should be 0,1,2). Detailed post: As you can see in following...

In a comment he made earlier today regarding someone else asking about a hotfix, this was his reply:

> **These sorts of bugs take time, so I**  
> **wouldn’t expect a fix to be**  
> **implemented for 4.9.**
> 
> **Hot fixes are reserved for editor**  
> **crashing bugs and the like. It’s**  
> **always possible that something will be**  
> **added to a hotfix if it’s a simple**  
> **enough adjustment and the developers**  
> **are able to sneak it in, but that’s**  
> **not common.**

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_a1d09d07](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_a1d09d07](https://forums.unrealengine.com/u/anonymous_user_a1d09d07)\
**Post date:** [September 3, 2015, 2:32am UTC](https://forums.unrealengine.com/t/blueprint-user-defined-enum-in-4-9-getting-corrupted/328211/9 "2015-09-03T02:32:12Z")

</div>

This bug is more severe though. Your bug is casting which is bad, but you don’t need to cast the enum for it to be wrong. It is corrupted internally and can even cause editor crashes. This bug completely cripples the use of Enums in BP and possibly even in code, and can under the right conditions cause the editor to crash as seen here: [Local variable crash in 4.9 - Programming & Scripting - Epic Developer Community Forums](https://answers.unrealengine.com/questions/275247/local-variable-crash-in-49.html)

Like I said its odd that the bug would still be present after Epic stated it was fixed, but if it is still there I hope they pounce on it because it is a significant issue. Maybe not a “hotfix” but at least a priority for 4.9.1

---

<div class="post-metadata">

**Author:** ![TJ\_V](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tj_v/32/1008648_2.png) [@TJ\_V](https://forums.unrealengine.com/u/TJ_V)\
**Post date:** [September 3, 2015, 4:58pm UTC](https://forums.unrealengine.com/t/blueprint-user-defined-enum-in-4-9-getting-corrupted/328211/10 "2015-09-03T16:58:16Z")

</div>

Hi John,

The issue that Invius is experiencing is a bit different that your original issue and it’s being investigated in the link that jtsmith provided.

I tested your original issue again in the official 4.9 release and it is working properly.
