RealDocs

UKismetSystemLibrary::GetPrimaryAssetIdFromSoftObjectReference

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

Description

Returns the Primary Asset Id for a soft object reference. Works from the asset path alone, so the object does not need to be loaded.

Caveats & Gotchas

  • Relies on the Asset Manager having scanned the target path into its registry; references to assets outside configured Primary Asset rules resolve to an invalid Id.

Signature

static FPrimaryAssetId GetPrimaryAssetIdFromSoftObjectReference(TSoftObjectPtr<UObject> SoftObjectReference)

Parameters

Name Type Description Default
SoftObjectReference TSoftObjectPtr<UObject> The soft object reference to look up, does not need to be loaded.

Return Type

FPrimaryAssetId

Example

Resolve an Id from a soft reference C++
TSoftObjectPtr<UObject> SoftRef(FSoftObjectPath(TEXT("/Game/Items/Sword_Iron.Sword_Iron")));
FPrimaryAssetId AssetId = UKismetSystemLibrary::GetPrimaryAssetIdFromSoftObjectReference(SoftRef);

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.