I’m trying to load all data assets of a certain type using GetPrimaryAssetDataList, but I just can’t get it to work.
- I have a test blueprint class named “MenuItem” inheriting primary data class.
- I have three test data assets: MenuItem_1, Menuitem_2 and MenuItem_3
- In Primary Asset Types to Scan, I added a section named “MenuItem”, with Asset Base Class set to my MenuItem class.
- Has Blueprint Classes is not checked (since I’m looking for data assets, not blueprint subclasses).
- The directory is set to /Game/TestMenu, I have double checked 1000 times to make sure the data assets are in the correct location.
Here is the code that is failing:
TArray<FAssetData> Assets;
UAssetManager::Get().GetPrimaryAssetDataList(PrimaryAssetType, Assets);
When I try to load something else, like a list of blueprint subclasses, it does work, so the issue is definitely with the specific type, and not with where the asset manager is referenced.
Why won’t this work with primary data assets though? Am I missing a step? I also tried with a class created in C++ instead of Blueprint, but that didn’t work either.