Description
The GameObjectFlags.NotNetworked
field is a member of the GameObjectFlags
enumeration in the Sandbox API. This flag is used to indicate that a game object should remain local and not be networked as part of the scene snapshot. This is useful for objects that should not be synchronized across the network, allowing them to exist only on the local client.
Usage
Use the GameObjectFlags.NotNetworked
flag when you want to ensure that a game object is not included in network synchronization. This can be particularly useful for objects that are meant to be client-specific or for testing purposes where network overhead should be minimized.
Example
// Example of using GameObjectFlags.NotNetworked
GameObject myLocalObject = new GameObject();
myLocalObject.Flags |= GameObjectFlags.NotNetworked;
// This object will not be networked and will remain local to the client.