Integrating with the Fusion Pooling system provided by Runtime Spawner
Runtime Spawner – Fusion Pool Provider Integration
How Fusion + Runtime Spawner Pooling Works
Runtime Spawner ships with a FusionPoolObjectProvider, a component that plugs directly into Fusion’s INetworkObjectProvider API.
This component must be the runner’s provider when using Runtime Spawner in Fusion mode.
Because Fusion only supports one provider per runner:
If you previously used Fusion’s NetworkObjectProviderDefault
Or your own custom provider
→ Runtime Spawner’s provider replaces it on that runner.
Runtime Spawner now owns pooling, Fusion still owns networking and authority replication.
What Runtime Spawner’s Fusion Pool Provider Does
With FusionPoolObjectProvider added to your NetworkRunner:
Fusion
Calls AcquirePrefabInstance() when it needs a new instance
Calls ReleaseInstance() when despawning a network object
Runtime Spawner
Provides the instance from its internal pool
Prewarms pools from SpawnEntries
Tracks per-entry + global population caps
Ensures proper enable/disable lifecycle for pooled instances
Ensures networked despawn goes through Fusion first but still returns to Runtime Spawner's pool
Fusion owns the network lifecycle.Runtime Spawner owns the object pooling.
How to Spawn and Despawn Objects
This is the #1 point users get stuck on, so here is the definitive guidance.
How Spawning Works
Automatic spawning
If you’re using:
Global spawners
Region spawners
Wave spawners
… then spawning is fully automatic.
You do not manually call Runner.Spawn().
Runtime Spawner internally drives spawning through its factory abstraction, and the Fusion pool provider ensures that:
Fusion sees the spawned object
The pooled instance is reused
Networking replication happens correctly
Users do not need to write any spawn code unless doing custom spawns.
Manual spawning (advanced / optional)
If your game needs to manually spawn something (e.g., player abilities, projectiles), you must go through Runtime Spawner’s factory, not Fusion directly.
Use:
But since this is advanced, typical users do not need this.
How to Despawn Objects
This is the most important part for Fusion users.
There are three correct ways to despawn something:
1. Automatic Despawn (waves, culling, region exit)
Runtime Spawner will:
Detect the despawn condition
Look up the ISpawnHandle associated with the instance
Call Runner.Despawn() (if networked)
Return the object to the pool
Update internal population bookkeeping
You don’t need to do anything.
2. Call RuntimeSpawner.Despawn(GameObject)
This is the recommended API for gameplay scripts.
This method:
Looks up the owning RuntimeSpawner
Checks if the object has a Fusion ISpawnHandle
If networked → calls handle.Despawn() → Fusion replicates despawn
If not → returns the object to the pool
Updates all internal population and SpawnEntry counts
This is the safest despawn method for Fusion + pooling.
public class MyWrappedFusionProvider : MonoBehaviour, INetworkObjectProvider
{
public FusionPoolObjectProvider rspProvider;
public NetworkObjectAcquireResult AcquirePrefabInstance(...) {
// pre logic
return rspProvider.AcquirePrefabInstance(...);
}
public bool ReleaseInstance(...) {
// post logic
return rspProvider.ReleaseInstance(...);
}
}