> 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-sync-animation.md).

# Network state sync animation

You can use a network state to synchronize playback of an animation. The example on this page shows how you can play and pause an animation.

{% hint style="info" %}
This example is similar to that shown in [Network state animation start/stop](/developer/creating-locations/network-states/example-network-state-configurations/network-state-animation-control.md). However, the arrangement shown on this page ensures that the timeline of the animation is synchronized across all users in a session. If you use only the play and pause commands, the animation can be at different stages depending on when users join the session, or can drift out of sync over long periods of time.
{% endhint %}

This example uses three networks states:

* The object to be animated includes an Animator component, and a `Network State Trigger_Synced Animation` script.
* Another network state is linked to the `Play Controller State` property of the `Network State Trigger_Synced Animation` script. This network state synchronizes whether the animation is playing.
* Another network state is linked to the `Pause Time Value State` property of the `Network State Trigger_Synced Animation` script. This network state synchronizes the point on the animation timeline where the animation is paused.

<figure><img src="https://2640392766-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yxYHsXtlAaoMUrDWhLm%2Fuploads%2Fgit-blob-ec52aa4f319896e7df62c32805e6293e665ebd8f%2Fnet_state_anim_synced_anim_overview.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

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

{% hint style="info" %}
To set the animation to play on load, set the `Current State` property to `1` in the `SyncedAnimation_Play` game object (blue in the following diagram), not the `SyncedAnimation_Play/Pause_object` game object (green in the following diagram).
{% endhint %}

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