> 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-change-animation/using-animator.play-string.md).

# Using Animator.Play(string)

You can use the `Animator.Play` method to play a specific animation clip. When you call the `Play` method, the animation clip begins to play immediately. If a different animation clip is playing when you call the `Play` method, the playing clip is interrupted.

{% hint style="info" %}
The example on this page uses the version of the Play method that takes a string parameter - which is the name of the animation clip that you want to play. There is also a version that takes an integer parameter - which is the index of the animation clip that you want to play.
{% endhint %}

This example is like the [Network state animation start/stop](/developer/creating-locations/network-states/example-network-state-configurations/network-state-animation-control.md)example, in that is uses a combination of a `NetworkStateTrigger_ToggleObjects` script to coordinate the network state, and an `OnEnableDoEvent` script to call the desired methods.

However, this example uses two buttons, which specifically set the state to 1 or 0, instead of a single button that toggles between the two states. Both methods are interchangeable and you can pick whichever matches your needs.

<figure><img src="https://2640392766-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yxYHsXtlAaoMUrDWhLm%2Fuploads%2Fgit-blob-56f6304a83446b6850feffab36133acfd76f93c6%2Fnet_state_anim_change_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.

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