Helpers
AsyncLoad Toolkit includes convenience functions that combine loading with a common follow-up action, handling the weak-pointer safety automatically.
Spawn Actor Async
Load an Actor class from a soft class reference and spawn it when ready.
Category: AsyncKit | Spawn
| Pin | Type | Description |
|---|---|---|
| World Context Object | UObject* | Auto-filled |
| Actor Class | TSoftClassPtr<AActor> | Soft reference to the actor class |
| Transform | FTransform | Spawn location / rotation / scale |
| On Spawned | FAsyncKitLoadedSingle | Receives the spawned AActor* cast to UObject* |
| On Failed | FAsyncKitFailed | Fires if loading or spawning fails |
| Params | FAsyncKitLoadParams | Options |
| Return | UAsyncKitHandle* | Handle |
Spawn Actor Async
Actor Class ──▶ MyEnemySoftClass
Transform ──▶ Spawn Point Transform
On Spawned ──▶ [Create Event] → Cast to MyEnemy → Initialize
If the world is destroyed or invalid by the time loading completes (e.g., during a level transition), the spawn is skipped silently.
Set Static Mesh Async
Load a StaticMesh from a soft reference and assign it to a UStaticMeshComponent when ready.
Category: AsyncKit | Apply
| Pin | Type | Description |
|---|---|---|
| Component | UStaticMeshComponent* | Target component |
| Mesh | TSoftObjectPtr<UStaticMesh> | Soft reference to the mesh |
| On Failed | FAsyncKitFailed | Fires on load failure |
| Params | FAsyncKitLoadParams | Options |
| Return | UAsyncKitHandle* | Handle |
If the component's owner is destroyed before loading completes, the assignment is silently skipped (weak pointer check).
Set Static Mesh Async
Component ──▶ My Mesh Component
Mesh ──▶ My Soft Mesh Ref
Typical use: for-each loop over a list of actors, asynchronously assigning a different mesh to each one without blocking the game thread.
Set Material Async
Load a MaterialInterface from a soft reference and assign it to a component slot when ready.
Category: AsyncKit | Apply
| Pin | Type | Description |
|---|---|---|
| Component | UPrimitiveComponent* | Target component (any primitive) |
| Element Index | int32 | Material slot index |
| Material | TSoftObjectPtr<UMaterialInterface> | Soft reference to the material |
| On Failed | FAsyncKitFailed | Fires on load failure |
| Params | FAsyncKitLoadParams | Options |
| Return | UAsyncKitHandle* | Handle |
Query functions
These pure functions check the in-memory state without triggering any load:
| Function | Returns | Description |
|---|---|---|
Is Asset Loaded | bool | True if the asset is currently in memory |
Get If Loaded | UObject* | The object if in memory, null otherwise |
Are All Loaded | bool | True if every asset in the array is in memory |
Debug functions
| Function | Returns | Description |
|---|---|---|
Get Active Request Count | int32 | Number of requests currently in flight |
Get In Flight Assets | TArray<FString> | Debug labels for all in-flight requests |
Use these with a Print String in a tick event to monitor load activity, or connect them to an on-screen debug widget.
You can also toggle the in-game overlay from the console:
AsyncLoadToolkit.Debug 1 ← show overlay
AsyncLoadToolkit.Debug 0 ← hide overlay
AsyncLoadToolkit.DumpRetained