Raising awareness for Struct/Enum modification bug / workaround

Wanted to post this to raise awareness for those creators that may use BP generated structs and enums in your projects.

TLDR: When you need to modify a BP generated struct or enum follow these steps

  1. Save your current work
  2. Make the change to the struct/enum (rename or add property/entry)
  3. Save the struct/enum
  4. Exit the editor WITHOUT SAVING anything else
  5. Relaunch the editor to resume working

More info:
When you modify a Struct or Enum that is already referenced in loaded BP classes, those referencing classes will be marked dirty. If you (very reasonably) Save All at this point, these referencing BPs will become damaged. You won’t see any errors in your BPs when working. However you will see errors in your output log when loading these BPs and your game will not package until they are resolved. Up until now this was a tedious process of renaming the struct/enum and then opening all referencing BPs and compiling / re-saving them.

Further, if you continue to work while your BPs are in this damaged state, it’s possible to fully corrupt them resulting in being able to no longer open them or other classes that reference them. I have had this fully brick projects where the asset reference chain would load corrupted BPs crashing the editor on launch.

For years I have run into this bug over and over in many engine versions and could never understand what the cause was. I recently found this youtube vid (not mine) that finally explained the cause and provides the workaround.

I reported a bug with full repro steps and logs on UDN so hopefully we can finally get this fixed.

For years I have run into this bug over and over in many engine versions

And it’s still there, indeed. I’ll have you know it can manifest without enumerators, you can have it happen by merely exposing / updating struct variable, too :innocent:. First time I run into this issue was around 2016/2017 (?) when structs declared in BPs were ridiculously prone to corruption. Since then I’ve been leaving slightly more detailed steps very much like yours dotted around the Anwer Hub and then the Forums. I reported it a bunch of times, too. Problem is, providing 100% repro steps cannot be done, can it?

I have provided 100% repro steps to epic in a bug report. They also already have the bug in their database with 100% repro steps. It’s been there for over 2 years. Not sure why it never gets fixed. :frowning:

1 Like

Same issue slightly different repro from 5.0.1

Please log in and vote for this issue if you have run into this bug.

My repro:

  1. Make a new unreal 3rd person template project (works in 5.3 and older I tested back to 4.6)
  2. Make a struct STNewStruct and put a float variable in it, OldVariable
  3. Make a new BP based on actor NewActor
  4. Add a variable of type STNewStruct to that class
  5. Place NewActor in the default loaded editor level and make sure that level is set to load on startup (important)
  6. Save All
  7. Close and relaunch the editor
  8. Open STNewStruct and add a new variable of type Transform, NewVariable
  9. NOTE: If you did the above you will see that NewActor is now marked dirty
  10. Save All without opening NewActor
  11. Restart the editor
  12. NOTE: In the Output log you will see Loading: Property 'StructProperty Unknown structure. error
1 Like

It now has a target fix for UE v5.5. #remindMeIn1Year

1 Like

its been around closer to 9 years so i dont have faith ha

1 Like

This is one of the worst things in the engine. Literally EVERY time we add a value to an enum or struct we have to restart the editor, else risk data lose.

1 Like