Description
The Snapshot
field of the NetworkMode
enumeration specifies that a GameObject
should be networked to other clients as part of the Scene
snapshot. This mode is useful for synchronizing the state of objects that are part of the scene and need to be updated across all clients simultaneously.
Usage
To use the Snapshot
network mode, set the NetworkMode
of a GameObject
to NetworkMode.Snapshot
. This will ensure that the object is included in the scene snapshot and its state is synchronized across all clients.
Example
// Example of setting a GameObject's network mode to Snapshot
GameObject myObject = new GameObject();
myObject.NetworkMode = NetworkMode.Snapshot;
// This will ensure that myObject is networked as part of the scene snapshot.