# 4. Animation and Variables

## Animation & Variables

This scene will show you how easy it is to set up Networking in your Unity project and sync GameObject transforms, animations via the Animator parameters and customer variables.

In this example, each client will have its own player character to move, the beloved Unity RobotKyle asset. Type your name into the connect dialog box and connect. You can move around with WASD. When another player connects, their name is carried across and their transform and animation state is replicated.

![](/files/-MWdmAQh2OAWWx8XoY5i)

### General Set Up

In the *Hierarchy* of the scene you can see the two core prefabs `Core Scene Setup` and `Coherence Setup.` Both are present in all scenes and described in detail in [Exploring the Network Playground](https://app.gitbook.com/s/-MWd0ZPEK7vE9nkE0b7G-2778409309/tutorial-project/network-playground/%7B%7B%3C%20ref%20starter_project_explore%20%3E%7D%7D).

### In This Scene...

`Coherence Kyle` is taken from the Unity asset "Robot Kyle", with added components `Rigidbody`, `Character Controller`, and `Animator` with the two animation states - Idle and Walk. The animation states are controlled by a speed parameter from the `Agent` script. The scene also contains a `Name Badge` script which gets the `Connect Dialog` GameObject from the `Core Scene Setup` and sets the color depending if it's local or networked.

Attached to `Coherence Kyle` is a coherenceSync component which replicates the parameters`Transform; position and rotation`, `Animator; Speed[float]` and `NameBadge; Name [string]`. The authority and persistence settings are set to their default values and the `On Network Instantiation` event is used to change the color of the networked entities.&#x20;

### Build and Try

You can build this Scene via the Build Settings. Run the local Replication Server through the *Window -> Coherence -> Settings* window and see how it works. You can try running multiple clients rather than just two and see replicating for each.&#x20;

You can read more about synchronizing animations on the [Animations](/0.4.14/authority/animation.md) section.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.coherence.io/0.4.14/tutorial-project/network-playground/animation-and-variables.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
