Data Assets go back to default settings after reopening Unreal Engine

I am using Data Assets to store values for my Characters, Abilities, items, weapons etc.

After the most recent UE5 update the Data Assets are being reset to their default values after closing and reopening the Engine.

Any insight into why this could be happening, how to prevent this from happening, would be greatly appreciated.

If a fix doesn’t come soon I will resort to using methods but I’ve already built my systems around Data Assets because they were working fine at the time and would like to use them if possible.

Notes: The Data Assets work fine in-game. The
I have tried deleting the saved and intermediate files, fixing up directories and validating assets.

[4-27][5-0EA]

it happens to me when i put maps with enums (as key or value) in data assets, and then modify the enum.
You can force reload of the asset, but you will have to do it each restart.
This is quite BS, for it seems to be radio silence on the matter for some reason, like we are the only two out there.

1 Like

well you ar enot the only two… this still happens.
thanks for the tip of force reloading though, that actually works.

This is still happening and it is very annoying. Forced to rely on Data Tables for now, but for reference, how do you force reload the asset?

Edit: never mind, found it.

Hi, I had the same problem as you, some of the data assets kept reverting to their default values when the editor was restarted (I should mention that I only do blueprints).

After searching, I think I have something. It seems that the problem occurs when you put a Data Asset as a variable within another Data Asset and the first Data Asset is referenced several times in this way.

My example: I have objects that I would like to drop resources when we destroy them. In my case, I would like my resources to be Data Assets. A DA_Metal, DA_Glass, DA_Plastic, etc… which all inherit a dedicated PrimaryDataAsset (PDA_Ressource). In these I have data that is specific to each type of resource (I won’t go into detail).

Then, for each destructible object, I make a DataAsset with its own PrimaryDataAsset too (PDA_Object). So for two objects, I have a Data Asset “Object1” and a Data Asset “Object2”. In the latter, I have a map variable named “resources” with the type of the resource as input (PDA_Ressource) and an integer as value. I come to choose the type of the resource and the amount of the resource that the object leaves on the ground.

Well, from then on, I noticed that my resources in the form of Data Asset had their values reset to zero on restart if and only if the Data Asset was referenced in both objects at the same time. If it was referenced only once or not at all, the values were retained.

My exploration of the problem ends here. I will just review the organisation of my assets a bit. Hopefully this will have helped you. :slight_smile:

PS : I left the same answer here : How to keep / save "data asset" datas (or is this a bug?) - #3 by Mathieu_Tactical

So, in my case, I experienced a similar wiping issue with a set of Blueprint struct types. I was led to this thread, because my structs was inside a Primary Data Asset, which I considered at first the most probable cause (turns out I was wrong).
My setup was that I had a Blueprint Struct (type A) which contained an array of Blueprint Structs (type B), themselves had an array of Structs (type C) as one of their struct member.

This kind of setup, while it doesn’t trigger any warning in the editor, caused the whole content of the struct (Type A to C) to be wiped out when the editor restarted. I assume it is due to nested arrays.
The solution is to introduce a new type, a fourth structure (kid you not), as a buffer between type B and C.

So now, the final architecture was:

Wrapper Struct type A-­>Array of Struct type B->Subwrapper Struct type C->Array of Struct type D

This kind of design can be useful to make dialog trees, albeit slightly inconvenient.

So if part of your struct or array get wiped out in or out of a Primary Data Asset, I suggest examining whether you have an array of struct, who themselves have an array of struct as member. If so, it may be a bug in the engine? I don’t know.

In my case, I duplicated the struct that was used in the data asset.
Then, in the data asset, I replaced the old struct with the duplicated struct.

At the time, I had just begun building these assets, but it would have been devastating if I had a ton of them to remake values…

Nowadays, every time I make a change to a struct or enum I do this:
-Save everything
-Open struct/enum and make change
-Save ONLY the struct/enum
-Close editor and IGNORE all the “unsaved asset” messages from assets that use the struct/enum
-Reopen editor

Same situation. I have a struct which contains (besides others) a map array with GameplayTag (Key) + Text (Value) in a data asset. This data asset is added in an editable variable in a character class. Every time I add an entry in an array of these character classes in the editor (with this data asset in it) to spawn these characters, the data asset empties after restarting the project.

I found the solution here. You have to go into project settings Game - Asset Manager and add your data assets to be loaded.