NetworkMode Snapshot

robot_2Generated
code_blocksInput

Description

The NetworkMode.Snapshot field is a member of the NetworkMode enumeration in the Sandbox API. It 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 game objects across clients in a scene, ensuring that all players have a consistent view of the game world.

Usage

To use the NetworkMode.Snapshot field, assign it to the NetworkMode property of a GameObject that you want to include in the scene snapshot. This will ensure that the object is networked to all clients as part of the scene's state.

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 included in the scene snapshot
// and its state is synchronized across all clients.