Skip to main content

Spawn Actor Async

Base:
UBlueprintAsyncActionBase
Type:
UNSpawnActorBlueprintAsyncAction
Header File:
NexusActorPools/Public/NSpawnActorBlueprintAsyncAction.h

An async Blueprint action that takes a TSoftClassPtr<AActor>, streams it in, ensures a FNActorPool exists for it, and then spawns an AActor at the supplied position and rotation. Like its sibling Get Actor Async, its purpose is to decouple hard references to Actor classes while still placing the resulting AActor into the world in a single step.

When To Use It​

  • Loading Decoupling: The Actor class is referenced as a soft asset; the action handles the load before spawning.
  • First-Use Cost Hiding: If no FNActorPool exists for the class yet, one is created on-demand using the project's Default Settings. The async action moves that work off the calling frame.
  • Reference Without Spawn: If you want the AActor returned without being placed in the world, use Get Actor Async instead. If you already hold a hard reference to the class, call SpawnActor on the UNActorPoolSubsystem directly.

Blueprint Surface​

InputDescription
ActorClassTSoftClassPtr<AActor> to load and spawn from a pool.
PositionWorld-space position to spawn the AActor at.
RotationWorld-space rotation to apply to the spawned AActor.
PinFires WhenPayload
CompletedThe class finishes loading and the subsystem spawns an AActor from the pool.SpawnedActor — the spawned AActor, or null on failure.

The pin always fires exactly once. Check SpawnedActor for null before using it.

Notes​

  • Honors all the pool flags of the resolved pool. In particular:
    • ServerOnly pools will return null on clients.
    • SweepBeforeSettingLocation is applied to the spawn transform.
    • ShouldFinishSpawning controls whether FinishSpawning() is invoked for non-INActorPoolItem classes.
  • The Strategy configured on the pool determines what happens if the pool is exhausted — see Creation Strategies. A strategy of CreateLimited or Fixed (without recycle) will return null rather than allocate a new AActor.