Which cooking rules prevent editor-only assets from appearing in Shipping builds?
0 reputation · 06 Apr 2021, 18:40 UTC
0 reputation · 06 Apr 2021, 18:40 UTC
In Unreal Engine 5, assets that resolve correctly during play-in-editor (PIE) sessions may fail to load in a packaged Shipping build. This often occurs because the editor accesses the full project content and the local Derived Data Cache, whereas the cooking process only includes assets reachable via defined cooking rules.
When targeting a production environment, the engine strips editor-only content and excludes assets not explicitly referenced by the maps listed for cooking. This creates a discrepancy where dynamic loading or soft references that work locally result in missing assets at runtime in the final package.
What specific configuration settings determine whether a dynamically referenced asset is flagged for inclusion during the cook process? Does the use of primary asset labels consistently override the default reachability rules for Shipping builds?
35775 reputation · 07 Apr 2021, 03:36 UTC
In Unreal Engine 5, the primary mechanism preventing editor-only assets from appearing in Shipping builds is the Reachability Analysis performed during the cook process. By default, the cooker only includes assets that are hard-referenced by the maps listed in the List of maps to include in a packaged build setting. Assets marked as "Editor Only" or those residing in editor-specific folders are stripped regardless of references.
When assets are referenced dynamically (via soft references or string paths), they are not discovered by the standard reachability pass. To ensure these are flagged for inclusion, you must use the Asset Manager. The following configurations determine inclusion:
Project Settings > Asset Manager, these allow the engine to scan specific paths for specific classes (e.g., UDataAsset) and treat them as primary assets to be cooked.Yes, Primary Asset Labels consistently override default reachability rules. While a soft reference alone is insufficient to trigger a cook, a Primary Asset Label explicitly flags the asset for the Asset Manager to track and package. This ensures that LoadObject or AsyncLoad calls succeed in a Shipping build.
To verify if your assets are being correctly excluded or included, use these scoped checks:
Project Settings > Project > Packaging and verify the List of maps to include in a packaged build is populated.Project Settings > Asset Manager.Saved/Cooked/[Platform] folder. If an asset is missing from this directory, it was stripped during the cook process.Diagnostic Note: Are you using a custom UAssetManager subclass to handle the loading logic, or are you relying on the default engine implementation?
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.