Core Concepts
ObjectPooling operates as an automatic memory manager for active game actors.
How Object Pooling Works#
When an actor returns to the pool:
- It is hidden in the game world (
SetActorHiddenInGame(true)). - Its collision and tick functions are disabled (
SetActorEnableCollision(false),SetActorTickEnabled(false)). - It is moved to a dormant pool location.
When you request an actor from the pool:
- ObjectPooling pulls a dormant instance from the pool.
- It resets the actor's position to your requested Spawn Transform.
- It reenables visibility, physics, and tick functions.
- It calls OnSpawnFromPool so your Blueprint can reset health, velocity, or effects.
Click to expand
Frame-Budgeted Pre-Warming#
Spawning 100 projectiles all at once at the start of a match can cause a hitch. ObjectPooling includes a Prewarm Pool feature that spawns a specified number of actors across several frames based on a time budget (e.g. max 2 milliseconds per frame), keeping frame rates smooth.