I’m trying to find assets of a type and decided the asset registry would be a better way than to have a massive array of “loaded assets” The trick is that I’m not actually getting any results back from the Asset Registry. I tried looking for something basic and got the
//Load the module
FAssetRegistryModule& AssetRegistryModule = FModuleManager::LoadModuleChecked<FAssetRegistryModule>("AssetRegistry");
//Setup output array
TArray<FAssetData> AssetData;
//Get the asset Registry and find assets of type RWallTile, store in AssetData, include subclasses
AssetRegistryModule.Get().GetAssetsByClass(ARWallTile::StaticClass()->GetFName(), AssetData,true);
//Output the result for testing
UE_LOG(LogTemp, Warning, TEXT("Found %d Assets of type %s"),AssetData.Num(), *ARWallTile::StaticClass()->GetFName().ToString());
This results in the following being output
LogTemp: Warning: Found 0 Assets of type RWallTile