ObjectPooling
ObjectPooling›Concepts›Core Concepts

Core Concepts

Stable

Understanding actor reuse, frame-budgeted warming, and lifecycle callbacks.

Core Concepts

ObjectPooling operates as an automatic memory manager for active game actors.

How Object Pooling Works#

When an actor returns to the pool:

  1. It is hidden in the game world (SetActorHiddenInGame(true)).
  2. Its collision and tick functions are disabled (SetActorEnableCollision(false), SetActorTickEnabled(false)).
  3. It is moved to a dormant pool location.

When you request an actor from the pool:

  1. ObjectPooling pulls a dormant instance from the pool.
  2. It resets the actor's position to your requested Spawn Transform.
  3. It reenables visibility, physics, and tick functions.
  4. It calls OnSpawnFromPool so your Blueprint can reset health, velocity, or effects.
Actor Lifecycle States
Click to expand
Visual Guide: Actor Lifecycle States

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.