NeoFox StudiosDocs
PoolIt · Unity Asset

PoolIt Documentation

A drop-in object pooling solution for Unity. Spawn, despawn and prewarm without ceremony — stop allocating, start shipping.

Overview #

PoolIt is a lightweight pooling system for Unity that removes the cost of repeated Instantiate / Destroy calls. It plugs in with two static method swaps, scales from a single bullet pool to dozens of independent pools, and ships with optional Playmaker and Bolt / Visual Scripting integrations.

This page documents version 1.0. Use the version selector in the top-right to switch to a different release.

Why pooling? #

Pooling is a system that helps you stop generating garbage when creating GameObjects. Every time an object is created and later destroyed, memory is freed the next time the garbage collector runs. If too much garbage piles up at once, the collector takes longer to free it — and that's where you see lag spikes and short freeze frames.

A pool front-loads that allocation. It creates a chunk of objects up front, then reuses them for the rest of the game. You pay the cost once, at a moment you control, instead of constantly during play.

Why PoolIt? #

  • Drop-in replacement. Swap Instantiate / Destroy and ship.
  • Plugin support. Playmaker and Bolt / Visual Scripting bindings included.
  • Strong performance improvement. Zero-GC spawn / despawn, configurable buffer growth.
  • Fast support. Discord and email — usually same-day.

Installation #

Import PoolIt into your project from the Unity Asset Store. After the import finishes, a welcome window opens automatically — press Next to move on to plugin setup.

Heads up

If the welcome window doesn't appear, you can re-open it any time from Tools → PoolIt → Welcome.

Plugins #

If you already use Playmaker or Bolt in your project, install the matching plugin from the welcome window. Press the Install button next to the relevant integration — PoolIt handles the rest.

Plugins can be installed later as well. See the Playmaker and Bolt / Visual Scripting sections.

Implementation #

The whole point of PoolIt: replace your Unity calls with the pooled equivalents.

csharp
// Before
var bullet = Instantiate(bulletPrefab, muzzle.position, muzzle.rotation);
Destroy(bullet, 2f);

// After
var bullet = PoolManager.Instantiate(bulletPrefab, muzzle.position, muzzle.rotation);
PoolManager.Destroy(bullet, 2f);

If no PoolManager exists in the scene, PoolIt creates one automatically with default settings — unlimited size, no preload. As soon as you want to configure preload, limits or buffer behavior, drop a PoolManager into the scene yourself before play.

Pool Manager Setup #

There are three ways to add a Pool Manager to your scene:

Via the Toolbar

GameObject → Pool It → PoolManager. A new Pool Manager appears in the scene, ready to configure.

Via the Hierarchy

Right-click in the Hierarchy and pick GameObject → PoolIt → PoolManager.

Manually

Create an empty GameObject, rename it PoolManager (recommended), and add the PoolManager component to it.

One per scene

If multiple Pool Managers exist in the scene, one will be deleted on play. Keep exactly one per scene (plus a Global one if needed — see Instantiate).

Instantiate #

Decide first whether the spawned object should be marked DontDestroyOnLoad:

  • Scene-scoped object → use the PoolManager class.
  • DontDestroyOnLoad object → use the GlobalPoolManager class.

Both classes expose static Instantiate and Destroymethods that mirror Unity's own — same overloads, same arguments.

csharp
// Scene-scoped
var enemy = PoolManager.Instantiate(enemyPrefab, spawnPoint.position, Quaternion.identity);

// Persists across scene loads
var music = GlobalPoolManager.Instantiate(musicEmitterPrefab);

Destroy #

Destruction works exactly like Unity's — the only thing to keep in mind is which manager owns the instance. Scene instances are released by PoolManager.Destroy(...); DontDestroyOnLoad instances are released by GlobalPoolManager.Destroy(...).

csharp
PoolManager.Destroy(enemy);
PoolManager.Destroy(bullet, 2f); // delay 2 s

Preload Amount #

Preload Amount tells the manager how many objects to spawn up-front at game start. Preloading prevents the first-use lag spike that comes from instantiating fresh objects mid-gameplay.

Reparent Option #

Controls whether a spawned GameObject is reparented when no parent was passed to Instantiate.

Reparent only in Editor
Reparented in the editor for tidy hierarchies; left alone in builds.
Reparent
Always reparented under the Pool Manager when no parent is specified.
Don't Reparent
Created at scene root, untouched.
Important

When Reparent only in Editor or Reparent is active, calling PoolObjects with DontDestroyOnLoad() during gameplay is no longer possible. Use PoolManager.DontDestroyOnLoad() instead, or instantiate the object through GlobalPoolManager from the start.

Limit Maximum #

A maximum lets you cap how many objects of a given pool can be active at the same time. Limit Options controls what happens when an instantiation is requested while the cap is already full.

First In, First Out
The oldest active instance is taken and reused for the new spawn.
No Instantiate
No new object is created. Instantiate returns null — handle this in your call site.

Buffer Settings #

When a pool runs dry, the buffer mode decides how it grows.

Exponential
Doubles the current pool size. Best for unpredictable bursts.
Percentage
Grows by a percentage of the current size.
Fixed Size
Grows by a fixed value you specify.

IPoolable #

IPoolable is an interface that lets a pooled component react to spawn and despawn events. Implement it on any MonoBehaviour that lives on a pooled prefab.

csharp
public class Bullet : MonoBehaviour, IPoolable
{
    public void OnSpawn()
    {
        // reset health, velocity, trails…
    }

    public void OnDestroy()
    {
        // clean up subscriptions
    }
}
Why not OnEnable / OnDisable?

You can fall back to Unity's OnEnable / OnDisable, but they aren't called when an instance is reusedafter the pool's maximum is hit (FIFO reuse). IPoolable always fires. Prefer it.

Delegates #

Fetch any pool with the static GetPool(GameObject prefab) and subscribe to its events:

csharp
var pool = PoolManager.GetPool(bulletPrefab);
pool.OnInstanceSpawned += instance => Debug.Log($"spawned {instance.name}");
OnInstanceAdded
An existing PoolObject is added to the pool.
OnInstanceRemoved
An object is manually removed from the pool.
OnInstanceSpawned
An object is spawned — whether brand-new or reused from the pool.
OnInstanceReused
An object already in the pool is picked up and reused.
OnInstanceDespawned
A PoolObject is switched off via Destroy.
OnInstanceSpawnFailed
A spawn was blocked — e.g. LimitMaximum is on and LimitOption is NoInstantiate.
OnNewInstanceCreated
A truly new object was instantiated to grow the pool (preload or buffer expansion).

Statistics #

The Statistics panel visualises live information about every pool in the scene — active count, total size, hits, misses — and an aggregated summary over all pools.

Event Based Spawner #

EventBasedPoolSpawner instantiates a PoolObject in the scene when a specified event fires. Supported events include:

  • Collision and Trigger callbacks (OnCollisionEnter, OnTriggerExit, …)
  • Time-based callbacks (after N seconds, on a repeating timer)
  • OnEnable / OnDisable
  • Audio events — when an AudioSource finishes
  • Particle events — when a ParticleSystem finishes

Event Based Destroyer #

EventBasedPoolDestroyer destroys PoolObjects on the same set of events as the Event Spawner. Drop it on a prefab to auto-release objects when an audio cue ends, a particle finishes, or a trigger fires — no glue code.

Playmaker Integration #

With Playmaker installed in your project, open Plugins and import the PoolIt → Playmaker integration. The following actions become available in the FSM action browser:

  • Pool Manager Instantiate
  • Pool Manager Destroy
  • Pool Manager Destroy Delay
  • …and their Global Pool Manager equivalents.

Bolt / Visual Scripting #

Unity 2020 or lower

To use PoolIt in Bolt you have to add its assembly to Bolt's allowlist. Open the Setup Wizard via Tools → Bolt → Setup Wizard, keep your existing preferences, and when the Assembly window appears press + to add a new entry. Pick PoolSystem.Runtime, finish the wizard, and you have full PoolIt access inside Bolt.

Unity 2021 or higher

The assembly list moved into Project Settings. Open Edit → Project Settings → Visual Scripting → Node Library, add PoolSystem.Runtime, then press Regenerate Units.

Support #

Missing a feature, or running into a bug? Reach out — usually same-day reply.

Discord
Channels for bugs, suggestions and help. discord.gg/m7saBYfEyj