Actor Pool Object
- Base:
- UObject
- Type:
- UNActorPoolObject
- Header File:
- NexusActorPools/Public/NActorPoolObject.h
A UObject wrapper around a native FNActorPool, giving Blueprints and UMG widgets a referenceable handle for an otherwise non-UObject pool. It is the bridge that lets the Developer Overlay — and any custom UI — observe and interact with a pool through standard BlueprintCallable methods and BindWidget plumbing.
As described this is meant only for interaction with UI, and you should explicitly use the UNActorPoolSubsystem methods otherwise.
What It Is​
- Blueprint Handle: Provides a
UObjectidentity for a pool so it can be stored inUPROPERTYreferences, passed to widgets, and bound to list views. - Thin Wrapper: Holds a raw
FNActorPool*and forwards calls to it; it does not own or duplicate any pool state. - Display-Aware: Caches the pool's template class name (with the trailing
_Cstripped) so UI surfaces can render it without re-querying the template every frame.
What It Does​
- Forwards Pool Operations:
Spawn(Position, Rotation),GetActor(), andReturn(Actor)defer directly to the underlying FNActorPool. All return safe defaults (nullptr,false) if the wrapper has not been linked. - Reports Pool State:
GetAvailableCount()andGetSpawnedCount()mirror the in/out collections, returning-1when unlinked so UI can distinguish "empty" from "no pool". - Surfaces Pool Configuration:
DoesSupportInterface(),ShouldInvokeUFunctions(), andGetDescription()expose the pool's flags and a human-readable description, used by the overlay's tooltips and color swatches. - Resolves Display Metadata:
GetClassName()returns the cached, sanitized template name;GetTemplate()andGetPoolWorld()provide the underlying class andUWorldfor richer lookups.
Creation​
UNActorPoolObject is not meant to be constructed directly in user code. Use the static factory, which allocates a transient instance and links it to a native pool in a single step.
FNActorPool* Pool = UNActorPoolSubsystem::Get(GetWorld())->GetActorPool(MyActorClass);
if (Pool != nullptr)
{
UNActorPoolObject* PoolObject = UNActorPoolObject::Create(WidgetOuter, Pool);
// PoolObject can now be passed to a UNListView entry, observed by Blueprints, etc.
}
The wrapper is created with RF_Transient — it is intended to be short-lived display state, not persisted. If the underlying FNActorPool is destroyed, the wrapper's calls will continue to forward and crash; tear down the wrapper alongside any UI that references it.
The Developer Overlay creates one UNActorPoolObject per known pool and feeds them into a UNActorPoolListViewEntry. Custom overlays can follow the same pattern.