RealDocs

UKismetSystemLibrary::GetObjectFromPrimaryAssetId

function Engine Blueprint Since unknown
#include "Kismet/KismetSystemLibrary.h"
Access: public Specifiers: staticBlueprintPure

Description

Returns the object associated with a Primary Asset Id, but only if it is already loaded in memory — this does not load the asset.

Caveats & Gotchas

  • Returns null if the asset isn't currently loaded; use the Asset Manager's LoadPrimaryAsset (or an async load) first if you need to guarantee it's available.
  • Requires the Asset Manager to know about this Primary Asset Id (i.e. it must be registered via the Primary Asset rules in project settings) — unregistered IDs also return null.
  • This is a pure/BlueprintPure query with no loading side effects, so it's safe to call every frame without triggering I/O.

Signature

static UObject* GetObjectFromPrimaryAssetId(FPrimaryAssetId PrimaryAssetId)

Parameters

Name Type Description Default
PrimaryAssetId FPrimaryAssetId The Primary Asset Id to look up.

Return Type

UObject*

Example

Get an already-loaded asset by its Primary Asset Id C++
FPrimaryAssetId AssetId(TEXT("Weapon"), TEXT("Sword"));
UObject* WeaponAsset = UKismetSystemLibrary::GetObjectFromPrimaryAssetId(AssetId);
if (WeaponAsset)
{
    // Asset was already resident in memory
}

Version History

Introduced in: unknown

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.