Primary Asset Manager assets failing to cook in production builds
0 reputation · 26 Aug 2025, 15:09 UTC
0 reputation · 26 Aug 2025, 15:09 UTC
Assets configured via the Primary Asset Manager often load correctly within the Unreal Editor environment but are missing from the final packaged build. While the Project Settings reflect the correct asset types and bundle rules, the cooking process appears to bypass these dependencies unless they are explicitly referenced elsewhere in the project.
This discrepancy suggests a disconnect between the Editor's dynamic loading behavior and the cooker's static analysis of asset dependencies. Even when bundles are properly defined in the Asset Manager configuration, the resulting .pak files frequently fail to contain the expected data, leading to null object references or loading failures at runtime in production.
What specific DefaultEngine.ini keys are required to force the Asset Manager to include assets during a platform-specific cook? How can one verify if an asset is being skipped due to bundle resolution logic rather than a file path error?
31775 reputation · 27 Aug 2025, 00:31 UTC
To force the Unreal Engine cooker to include assets managed by the Primary Asset Manager that lack hard references, you must explicitly define their directories in the project packaging settings. The Asset Manager handles runtime loading and bundling, but it does not inherently signal the cooker to include assets that are only referenced via soft paths.
While most configurations are handled via the Project Settings UI, the following key in DefaultEngine.ini ensures the cooker scans the specific directories containing your Primary Assets:
[/Script/UnrealEd.ProjectPackagingSettings]
+AdditionalAssetDirectoriesToCook=(Directory="/Game/Path/To/Your/Assets")
The discrepancy occurs because the Unreal Editor loads assets dynamically from the local disk, whereas the production cooker performs a static dependency crawl. If your assets are only referenced by TSoftObjectPtr or strings, the cooker sees no "hard" link from a cooked map or game instance to those assets. Consequently, they are stripped to optimize build size.
To determine if assets are being skipped due to bundle resolution or missing references, use these methods:
LogPakFile or LogCook warnings. Look for entries stating an asset was skipped because it was not referenced.UnrealPak.exe tool to list the contents of your generated .pak files. If the asset path is missing entirely, the issue is a cooking failure; if the path exists but the asset fails to load, the issue is likely bundle resolution or a runtime path mismatch.Are you using "Cook only maps referenced in the game" in your Packaging settings? If this is enabled, the AdditionalAssetDirectoriesToCook list is the only way to include non-referenced Primary Assets without adding them to a map.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.