I created a blueprint class extending from PrimaryDataAsset to hold some level information.
I then created a DataAsset from that blueprint class and filled with the data I need. After that i went to ProjectSettings → AssetManager → Primary Asset Types to Scan and added my class to scan for and the directory where DataAsset with data is.
After I try to find it with the node Get Primary Asset Id List I get 0 assets. Any idea what am I missing?
Hey, got your same problem, took some time to figure out why it wasn’t working for me:
The UPrimaryDataAsset has an ovveride for the ::GetPrimaryAssetId that returns an Id that uses the class name for the PrimaryAssetType; further more, this is then stored in the .uasset file itself. When checking for possible assets, the asset manager uses the AssetData (different from DataAsset, confusing I know) to tell the PrimaryAssetType of a .uasset, which reads the field stored in the .uasset; this will be the class name, and will not match with the PrimaryAssetType name you used in the project settings, preventing it from successfully scanning
To fix this:
use UDataAsset base class instead. otherwise, override the ::GetPrimaryAssetId function (i invoke the UObject::GetPrimaryAssetId for example)
in either case, be sure to delete and recreate the assets after you’ve done one of the two, because the .uasset file will still have the PrimaryAssetType field with the class name if you don’t delete the uasset, and it will prevent the file from successfully scanning