> For the complete documentation index, see [llms.txt](https://docs.engagevr.io/developer/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.engagevr.io/developer/creating-locations/network-states/example-network-state-configurations/network-state-toggle-object.md).

# 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](/developer/creating-locations/network-states/example-network-state-configurations/network-state-animation-control.md).

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

<figure><img src="https://2640392766-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yxYHsXtlAaoMUrDWhLm%2Fuploads%2Fgit-blob-54bfb1d7f39ce08ee78bfcc05c5bef8a196e9d6e%2Fnet_state_toggle_object_overview.png?alt=media" alt="" width="431"><figcaption><p>Component overview</p></figcaption></figure>

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

{% hint style="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.
{% endhint %}

<figure><img src="https://2640392766-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yxYHsXtlAaoMUrDWhLm%2Fuploads%2Fgit-blob-b5367c8c0d59ffa269d45396ddeb8bdedd477f06%2Fnet_state_obj_toggle.png?alt=media" alt=""><figcaption><p>Example use of network states to toggle an object</p></figcaption></figure>
