Struct Data Resetting to Default Values on Editor Restart

Hello Unreal Community,

I’ve encountered a really frustrating issue in my recent project.

I have a struct that is resetting to default values every time I restart the Editor. I first noticed the issue yesterday and it’s been persisting ever since.

Brief overview of my setup: The struct in question is used within my base ability class (that has 3 other children for specific ability categories - Primary, Secondary and Ultimate where each then has children as well for the abilities themselves).

Interestingly, every time I restart the Unreal Editor, all members of this struct reset to their default values (but not for all abilities, weirdly).
Let’s say I want to change the Category (Enum). Depending on the child class, it is set to either Primary, Secondary, or Ultimate. Once I reset the editor, this goes back to the default value ‘Primary’ for each class.

Other members of the struct like Name, Icon, Cooldown etc., which are set within the actual abilities themselves (rather than the 3 parents), do not seem to be affected by this issue and persist as expected (however, 2 abilities reset anyway).

Since this is a bit hard to explain in plain text, I have recorded a quick video with my commentary.

VIDEO LINK HERE

I appreciate any help possible :innocent:
Thanks!

2 Likes

UPDATE: The bug has been solved!

I’ve managed to find a workaround to this bug and thought it’s worth sharing in case someone else runs into the same problem (since I’ve seen couple of posts that go way back regarding this issue).

Here is what I did:

  • I set the struct variable to not replicate and saved my project. If yours is not replicating, you may try to set it to replicate instead (for now, you can revert it later).

  • I then closed the Editor.

  • Upon reopening the editor again, I set the variable back to being replicated as it was initially (you may do the opposite as mentioned above), saved and closed the project once more.

  • After opening the Editor again, I found that the struct data was no longer resetting on Editor restart - and not only that, but data that has been previously lost now has been restored.

I’m not 100% sure how this fixed the issue, but my theory is that the variable got stuck in some bugged state that prevented it from being saved and by manipulating its settings (the replication), it forced the Engine to ‘refresh’ the variable.

I hope this helps in case anyone has the same issue.

Best of luck with your projects! :blush:

6 Likes

Thanks chief, you saved my life :D.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.