AssetRegistry's GetSubPaths not working for Standalone Game mode

AssetRegistry’s GetSubPaths doesn’t work in Standalone Game mode.

    FAssetRegistryModule* FA = &FModuleManager::LoadModuleChecked<FAssetRegistryModule>(FName("AssetRegistry"));
    	IAssetRegistry& AR = FA->Get();
    	TArray<FString> PathsToScan;
    	AR.GetSubPaths(TEXT("/Game"), PathsToScan, true);
    	AR.ScanPathsSynchronous(PathsToScan, true);

This should put all paths in the content folder into the PathsToScan Array.
But nothing is in there. It works fine for PIE or even packaged game though.

Further investigations show that the CachedPathTree (AssetRegistry.cpp) isn’t initialized.

In Editor mode the function SearchAllAssets is called, in packaged game the AssetRegistry.bin is loaded. Both will apparently fill the CachedPathTree.

Since i dont know how to find out if the game runs in standalone mode, i can’t provide a fix, but it should be in the constructor of FAssetRegistry.

Regards

  • Algorithman

Hello Algorithman,

Thank you for reporting this issue. I’ve placed a bug report in for the issue which you can find here: UE-41270. You should be able to follow that post for any updates made to the report.

Have a nice day!