UKismetSystemLibrary::GetPrimaryAssetsWithBundleState
#include "Kismet/KismetSystemLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintCallable
Description
Returns every Primary Asset currently loaded with a matching set of bundles. RequiredBundles must be specified; ExcludedBundles and ValidTypes further narrow the results.
Caveats & Gotchas
- • This scans all currently-loaded Primary Assets, so it can be relatively expensive with a large asset registry — avoid calling it every frame.
- • ExcludedBundles and ValidTypes use AutoCreateRefTerm in Blueprint, so leaving those pins unconnected passes empty arrays (meaning "no exclusion" / "any type"), not an error.
Signature
static void GetPrimaryAssetsWithBundleState(const TArray<FName>& RequiredBundles, const TArray<FName>& ExcludedBundles, const TArray<FPrimaryAssetType>& ValidTypes, bool bForceCurrentState, TArray<FPrimaryAssetId>& OutPrimaryAssetIdList) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| RequiredBundles | const TArray<FName>& | Bundle names that must all be loaded for an asset to be included. | — |
| ExcludedBundles | const TArray<FName>& | If non-empty, assets currently loaded in any of these bundle states are excluded from the result. | — |
| ValidTypes | const TArray<FPrimaryAssetType>& | If non-empty, only assets of these Primary Asset Types are considered. | — |
| bForceCurrentState | bool | If true, uses the current bundle state even if a load for the asset is still in progress. | — |
| OutPrimaryAssetIdList | TArray<FPrimaryAssetId>& | Filled with the Primary Asset Ids matching the bundle filters. | — |
Return Type
void Example
Find all items with their UI bundle loaded C++
TArray<FPrimaryAssetId> Matches;
UKismetSystemLibrary::GetPrimaryAssetsWithBundleState(
{ FName("UI") },
TArray<FName>(),
{ FPrimaryAssetType(TEXT("Item")) },
/*bForceCurrentState=*/false,
Matches); Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?