Interfaces
The INetworkScriptableFactory interface hierarchy extends the IScriptableFactory interfaces with network spawning capabilities. Three levels of interface progressively add: network identity, network spawning, and data-driven variant network spawning.
Architecture
Interface Tiers
Identity
IScriptableFactory
GlobalObjectIdHash for Netcode prefab identification
Spawning
IScriptableFactory<TObject> + INetworkScriptableFactory
NetworkSpawn() with ownership and prediction support
Data
IScriptableFactory<TObject, TData> + INetworkScriptableFactory<TObject>
Variant-aware NetworkSpawn() with variant ID
Each network interface inherits from both the corresponding IScriptableFactory tier and the network tier above it, forming a diamond inheritance pattern. This ensures a network factory can be used anywhere a regular IScriptableFactory is expected.
Spawn vs NetworkSpawn
Spawn()
IScriptableFactory<TObject>
Local only
None — object exists only on the calling machine
NetworkSpawn()
INetworkScriptableFactory<TObject>
Server-authoritative
Netcode replicates to all connected clients
Always use NetworkSpawn() for multiplayer objects. Using the inherited Spawn() from IScriptableFactory creates a local-only object that is not visible to other clients and is not managed by Netcode.
Interfaces
Base network factory contract — adds GlobalObjectIdHash
Adds NetworkSpawn() with ownership and prediction
Adds variant-aware NetworkSpawn() with variant ID
See Also
Network Factory — subsystem overview
IScriptableFactory Interfaces — parent interface hierarchy
FactorableBehaviour — base class for network-spawnable objects
IFactorable — factorable object contract
Last updated