ScriptableObject factory that provides a Fusion-backed implementation of IObjectFactory.
More...
ScriptableObject factory that provides a Fusion-backed implementation of IObjectFactory.
Spawning and despawning are performed through NetworkRunner.Spawn(NetworkObject, Vector3, Quaternion, PlayerRef) and NetworkRunner.Despawn(NetworkObject), producing/consuming NetworkObject instances compatible with the RuntimeSpawner system.
When serverOnly is true, spawn requests are honored only on the authoritative host/server. Clients will not attempt local instantiation and will instead receive objects through Fusion replication. Set this to false only if you have a custom non-authoritative flow.
For optimal performance and reuse, start your runner with a pooling INetworkObjectProvider: either attach FusionPoolObjectProviderBehaviour to the NetworkRunner GameObject, or construct a FusionPoolProvider and pass it via StartGameArgs.ObjectProvider when calling StartGame. Spawning will still function with other providers, but pooled reuse will not apply.
- See also
- IObjectFactory, FusionObjectFactory, NetworkRunner, NetworkObject, FusionPoolObjectProviderBehaviour, FusionPoolProvider