Network state toggle object

You can use a network state to toggle whether a game object is active. The most basic use of this is to toggle the visibility of a 3D object. However, you can use the activation and deactivation to trigger other events. For a more advanced example, see Network state animation start/stop.

The following diagram shows the components required to toggle an object in response to a button press, and to synchronize that change between users.

Component overview

The following diagram shows an example of how to arrange the components in Unity, and the required references.

circle-info

In the LVR_Location_Network_State component, use the Current State property to set the game object's initial state when the location loads. Enter 0 for the game object to start inactive, and enter 1 for the game object to start active.

Example use of network states to toggle an object

Last updated