# \[Solved\] Troubleshooting Primary Assets

**URL:** <https://forums.unrealengine.com/t/solved-troubleshooting-primary-assets/1733737>\
**Category:** Programming & Scripting\
**Tags:** data-asset, unreal-engine\
**Created:** [March 6, 2024, 12:20pm UTC](https://forums.unrealengine.com/t/solved-troubleshooting-primary-assets/1733737 "2024-03-06T12:20:03Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ari\_Epic](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ari_epic/32/1225266_2.png) [@Ari\_Epic](https://forums.unrealengine.com/u/Ari_Epic)\
**Post date:** [March 6, 2024, 12:20pm UTC](https://forums.unrealengine.com/t/solved-troubleshooting-primary-assets/1733737/1 "2024-03-06T12:20:03Z")

</div>

I recently wrote a guide on UDN to help someone troubleshoot Primary Assets, pasting it here for a wider audience.

# What is a Primary Asset in Unreal?

First read this primer, [https://docs.unrealengine.com/asset-management-in-unreal-engine/](https://docs.unrealengine.com/asset-management-in-unreal-engine/).

A Primary Asset in Unreal is any asset that fulfills these two conditions:

**1: It’s any asset that has had the “Primary Asset Type” and “Primary Asset Name” Asset Registry values filled.**

To populate these values for any asset it needs to have a native class in the parent hierarchy that overrides the `GetPrimaryAssetId()` function (or responds to the `FCoreUObjectDelegates::GetPrimaryAssetIdForObject` delegate for that object).

You can see immediately if the asset has its Primary Asset fields correctly set by hovering over it in the Content Browser after saving it, since they get saved into the Asset Registry:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/d/0/5d03482d89a98909c10ef4531b915d23474b0bee.png "MyDataAsset which displays two fields when hovered over, Primary Asset Type and Primary Asset Name.")

We have a helper base class which we recommend using, `UPrimaryDataAsset`. It has neat functionality like automatically filling in the `PrimaryAssetID` based on the asset parent class and the asset name, and it adds support for Asset Bundles.

If you want to use `UPrimaryDataAsset` then you HAVE to create a C++ that extends it as the base class for any assets, consider `UPrimaryDataAsset` as an Abstract class. You can also have a parent Blueprint class as the parent for your assets, but that Blueprint class also needs to have your custom C++ class as the parent, not `UPrimaryDataAsset` directly. I generally recommend against having a BP parent class for Data Assets due to some rare bugs happening with circular BP references causing data loss.

**2: It needs to be scanned by the Asset Manager.**

You make the Asset Manager scan it by adding a “Primary Asset Types to Scan” entry in the Project Settings under Game → Asset Manager.

Remember to also put in the folder path of the assets to scan.

If the assets you want to scan are Blueprints then you need to check the “Has Blueprint Classes” checkmark. Blueprints need special handling compared to other types (like DataAssets, Maps, or anything really) since they need to be compiled and the generated class is treated differently than other native classes.

# Why use Primary Assets?

There are a few reasons why someone might want to use Primary Assets in their project:

## Dynamic querying and loading

Primary Assets can be loaded via the Asset Manager using only their ID, and you can query all Primary Asset of each class via the Asset Registry. This allows you to programmatically and dynamically query and load primary assets without first having an array of references to them.  
An example would be to have all possible random collectibles that can spawn from a chest be Primary Assets. This makes it easy to add more collectibles without having to remember to add them to an array somewhere.

## Asset Bundle support

Asset Bundles in Unreal are a bit different from Asset Bundles in other engines, it’s not a bundle of assets in a file like Unreal’s pak chunks are. Instead, it’s the ability to bundle specific assets with the loading operation of a Primary Asset (specifically one inheriting from `UPrimaryDataAsset`, which is the class that adds that ability.)

> Side note: If you need a different parent class but still want to have Asset Bundling support just copy the asset bundling code from `UPrimaryDataAsset` into your other class.

For an example, lets say we have a `UWeapon` Primary Asset class. This `UWeapon` class has a soft object pointer to an image of the weapon that should only be shown in the store UI. Otherwise we don’t need to load that image. But sometimes when we load the `UWeapon` asset it’s because we want to show the weapon model in-game, then we have another soft object pointer to the 3d mesh that should only be loaded when a game match is starting.

Soft object pointers are by default not loaded with the parent asset, you’ll need to manually load them yourself. But using Asset Bundling you “bundle” the loading of a specific soft object pointer with the primary asset itself.

Here’s how the UPROPERTIES might look like in your Weapon class:

```auto
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "StaticMesh", meta = (AssetBundles = "InMatch"))
TSoftObjectPtr<UStaticMesh> WeaponMesh;

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Textures", meta = (AssetBundles = "Store"))
TSoftObjectPtr<Texture2D> WeaponStoreIcon;

```

By default those are not loaded with the `UWeapon` asset. But if you use the Asset Manager to load your `UWeapon` Primary Asset you can now specify Bundles to load additionally:

```auto
TSharedPtr<FStreamableHandle> WeaponHandle = UAssetManager::Get().LoadPrimaryAsset(FPrimaryAssetId(TEXT("Weapon:Shotgun")), TArray<FName> { TEXT("Store") }, FStreamableDelegate::CreateUObject(this, &UWeaponManager::OnWeaponLoaded));

```

The “OnWeaponLoaded” delegate will only trigger once the weapon asset AND the store texture have been loaded.  
The bundled assets will stay loaded as long as either that WeaponHandle exists, or as long as something else references those assets. Otherwise it will get garbage collected.

## Set Cooking Rules

By default [Unreal cooks everything](https://dev.epicgames.com/community/learning/tutorials/l3E0/myth-busting-best-practices-in-unreal-engine#uecookseverythingbydefault?), or if you’ve set it to, it will only cook all Maps in your project and all assets those map reference (I’m over simplifying, there are other ways assets are included in a build that I’m skipping over.)  
If you’re only cooking maps and what they reference, it means if you somehow don’t reference your assets then they won’t be cooked. But what if you have lots of collectibles, weapons, or enemies that are only ever loaded dynamically from their IDs? That’s where PrimaryAssetRules come in. You simply set up your Primary Assets in the “Primary Asset Types to Scan” property in the project settings and now you can specify that the cooking rule for Collectibles is “AlwaysCook”.

A workaround would be to put them into an AlwaysCook folder, which would work, but I recommend not using AlwaysCook folders and instead marking assets as Primary Assets with their own cook rules.

You are also able to specify different pak chunks for your primary assets, separating the pak files in your game.

For more info about Primary Assets please check out these resources:  
[Asset Management in Unreal Engine | Unreal Engine 5.3 Documentation](https://docs.unrealengine.com/5.3/en-US/asset-management-in-unreal-engine/)  
[Asset Manager for Data Assets & Async Loading - Tom Looman](https://www.tomlooman.com/unreal-engine-asset-manager-async-loading/)

---

<div class="post-metadata">

**Author:** ![nande](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nande/32/1057698_2.png) [@nande](https://forums.unrealengine.com/u/nande)\
**Post date:** [August 29, 2025, 2:44am UTC](https://forums.unrealengine.com/t/solved-troubleshooting-primary-assets/1733737/2 "2025-08-29T02:44:29Z")

</div>

Great info Ari! Thanks!

---

<div class="post-metadata">

**Author:** ![pakoneko](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/pakoneko/32/1161146_2.png) [@pakoneko](https://forums.unrealengine.com/u/pakoneko)\
**Post date:** [August 29, 2025, 7:11pm UTC](https://forums.unrealengine.com/t/solved-troubleshooting-primary-assets/1733737/3 "2025-08-29T19:11:31Z")

</div>

When working with Asset Manager, I encountered an unexpected challenge.

Following the best practices outlined in the community and documentation,

I created a subclass of Primary Data Asset named `PDA_WeaponBase_C` and added several Data Asset instances.

The `Primary Asset Type` was correctly configured as `PDA_Weapon_C`, and the path, type settings appeared to be accurate.

 ![assetmanager1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/e/7/fe7eae2c94b60ab8b4fdd112a3d3218b25aa5bf6.png)

To load the resources, I utilized the `Get Object From Primary Asset Id` function.

However, upon closing and reopening the editor, the function consistently returns `Unknown`.

 ![assetmanager2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/5/d/f5dc56d9c2c0dcfa37dd3904fb446357f65dadf9.png)

 ![assetmanager3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/5/7/457eb103ae00526efce86335c21fb9d5a9448df8.png)

To address this, I need to manually right-click the asset and select `Validate Assets` for it to load correctly.

 ![assetmanager4](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/3/1/13179731ae421d2291427c2d3a25f9fb0feed90a.png)

 ![assetmanager5](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/4/d/e4db3b062fa9c9969a6d39a82b8755b85737fea6.png)

Once validated, everything functions as expected, but the issue reoccurs every time I close and reopen the editor, causing the assets to fail to load again.

As a beginner in using blueprints, what might be going wrong? I hope to receive some guidance and assistance. Thank you very much!

---

<div class="post-metadata">

**Author:** ![Ari\_Epic](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ari_epic/32/1225266_2.png) [@Ari\_Epic](https://forums.unrealengine.com/u/Ari_Epic)\
**Post date:** [September 3, 2025, 8:24am UTC](https://forums.unrealengine.com/t/solved-troubleshooting-primary-assets/1733737/4 "2025-09-03T08:24:48Z")

</div>

@pakoneko that function only gives you the asset if it is already loaded. If you do some action on the asset in the Editor, like calling “Validate Assets” on it, then the Editor loads the asset, and it is kept in memory.

As the function’s comment states:

> GetObjectFromPrimaryAssetId: Returns the Object associated with a Primary Asset Id, this will only return a valid object if it is in memory, it will not load it.

You should instead use the `Async Load Primary Asset Class` (for Blueprints) and `Async Load Primary Asset` (for other assets, like meshes or Data Assets) functions to load the primary asset at runtime.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/b/c/1bc7478d4af99827f008e33dd4ea45cc05f295f5.png)

---

<div class="post-metadata">

**Author:** ![pakoneko](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/pakoneko/32/1161146_2.png) [@pakoneko](https://forums.unrealengine.com/u/pakoneko)\
**Post date:** [September 4, 2025, 4:20am UTC](https://forums.unrealengine.com/t/solved-troubleshooting-primary-assets/1733737/5 "2025-09-04T04:20:25Z")

</div>

Thank you so much! I will carefully try the two methods you provided and choose the most suitable one to accomplish my functionality. I truly appreciate your prompt response!👏

---

<div class="post-metadata">

**Author:** ![volumetrix](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@volumetrix](https://forums.unrealengine.com/u/volumetrix)\
**Post date:** [January 18, 2026, 5:42pm UTC](https://forums.unrealengine.com/t/solved-troubleshooting-primary-assets/1733737/6 "2026-01-18T17:42:34Z")

</div>

I ran into an issue with using the asset manager. If two requests for the same asset are made, only one delegate ends up being called. Using the example from above:

```auto
// In WeaponManager.cpp
UAssetManager::Get().LoadPrimaryAsset(FPrimaryAssetId(TEXT("Weapon:Shotgun")), TArray<FName> { TEXT("Store") }, FStreamableDelegate::CreateUObject(this, &UWeaponManager::FunctionOne));

...

// In AnotherManager.cpp
UAssetManager::Get().LoadPrimaryAsset(FPrimaryAssetId(TEXT("Weapon:Shotgun")), TArray<FName> { TEXT("InMatch") }, FStreamableDelegate::CreateUObject(this, &UAnotherManager::FunctionTwo));

```

This seems like a reasonable use case: different code is requesting different bundles from the same asset without knowing if anything else has been loaded. However, it seems that only one of the delegates ends up being called. Either one works fine when the other call is removed.

Is this expected behaviour or a bug?  
Is this internally overwriting the delegate to call for the given asset id?  
Can we add a delegate to an existing load?

---

<div class="post-metadata">

**Author:** ![AugustoDamasceno](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/augustodamasceno/32/738946_2.png) [@AugustoDamasceno](https://forums.unrealengine.com/u/AugustoDamasceno)\
**Post date:** [March 10, 2026, 1:16am UTC](https://forums.unrealengine.com/t/solved-troubleshooting-primary-assets/1733737/7 "2026-03-10T01:16:03Z")

</div>

**Quick Tip — `Get Primary Asset ID List` Returning Empty**

If `Get Primary Asset ID List` returns an empty array even though your `PrimaryDataAsset` and Asset Manager settings are configured correctly, check your class constructor.

If your `UPrimaryDataAsset` subclass defines a constructor and **does not call the parent constructor (`Super`)**, Unreal may skip some internal initialization required for the Asset Manager to register the asset properly.

**Example fix:**

```cpp
USkinDataAsset::USkinDataAsset()
    : Super()
{
}

```

or simply remove the constructor if it is not needed.

Failing to call `Super()` can prevent the asset from being correctly registered, causing `Get Primary Asset ID List` to return empty even when the assets exist and the directories are configured correctly.

---

<div class="post-metadata">

**Author:** ![TheGangRobin](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/thegangrobin/32/1036420_2.png) [@TheGangRobin](https://forums.unrealengine.com/u/TheGangRobin)\
**Post date:** [April 29, 2026, 8:48am UTC](https://forums.unrealengine.com/t/solved-troubleshooting-primary-assets/1733737/8 "2026-04-29T08:48:05Z")

</div>

OK - we had a “nice” debugging session for Primary Data Assets that seemingly was setup correctly.

We had a Primary Data Asset class (Class A) and additional subclass (Class B), we intended both to share the same Primary Asset Type.

We created the data assets of type Class B in the editor BEFORE we remembered to add an override of GetPrimaryAssetId().

This caused the PrimaryAssetType to be saved in the Primary Data Asset .uasset file to become Class B (even though the Editor UI displayed Class A).

So when we tried to fetch all assets of Class A (incl. subclasses) we got zero results.

**Solution:**

- Ensure that GetPrimaryAssetId() is properly overridden
- Select all the Primary Data Asset → Right Click → Save

**Root cause:**

- The PrimaryAssetType is written to the actual .uasset file and not only fetched from the inheritance chain
