I have some Blueprint subclasses of PrimaryDataAsset whose references are being lost after restarting the editor

I’ve got a subclass of PrimaryDataAsset and when i create a variable type of that subclass, it’s references will sometimes be completely wiped when restarting the editor.

It happens with some but not for others. Has anyone else had this problem, and if so, where you able to fix it?

I’v been messing around with primary data assets lately and have not had this issue, do you have the asset directories setup inside project settings to include your subclass?

I’m not sure that i do, actually. Now that i think of it, it might make sense that the references are lost if the data asset itself is not loaded. I’ll look into the Asset Manager and making sure that stuff is set up correctly and get back.

Yes, you’ll find it under project settings → Game - Asset Manager. You can add a new primary asset to the array and there is a few important settings to check out, the asset base class, directories, and cook rules. (underlined in yellow).

Hope that works for ya!

I have my project settings like this

I’m still getting this load error when i start my project.

This is a shot of my dataclass after i load, the InventoryData references are wiped out, presumably because they couldn’t be loaded. The asset still “References” the correct asset in the reference viewer, they just don’t show up.

These dataclasses have a native C++ Class which is subclassed from PrimaryDataAsset, btw. There is then a Blueprint subclass that the dataclass instances are parented to. Not sure if that makes a difference or not. I’m starting to wonder if i should be using Primary Data asset or just nativising the Dataclasses and subclassing them from UDataAsset. Any ideas?

So i want this data to always be loaded anyways - should i even be playing around with the asset manager if that’s the behavior i want?

Hmm, im not 100% sure why it’s doing that. If you always want them loaded then there’s not much you need to do with the asset manager. Did you override the GetPrimaryAssetId inside the c++ class? I’m not sure if that will help, but I do know its required to use custom primary data assets correctly.

This is what I did in mine, and I’m not having any issues. Sorry I couldn’t help more.

Header:

256491-annotation.png

CPP:

256492-annotation2.png

Thank you one and all for your views about the issue; I have been thinking to post the same but no need.
Regards,
KarmikSundar - Developer at Uktvnow Official

I haven’t done that, actually. I’ll give that a shot and get back.
One thing that did help, however, is that i had some redirectors that seemed to be causing some issues. After fixing the redirectors, things started working again.

Awesome, glad you got it working. Good to know to!

Thanks a lot for the quick solution sir, I would love to make use of the tutorial shared above and fix the issue, thanks.