# 3. Test your game locally

Now we can build the project and try out network replication locally. To do so, we need to launch and connect to a [Replication Server](https://docs.coherence.io/manual/replication-server).

## Run a local Replication Server

You can run a local Replication Server directly on your machine! You can either:

* Launch the Replication Server from the menu

<figure><img src="https://content.gitbook.com/content/CMCtKgV0bk1lwR4tWK3W/blobs/nA4aZ5q1LjX0O74DJWbS/image.png" alt=""><figcaption></figcaption></figure>

* Or through the **Hub**

<figure><img src="https://content.gitbook.com/content/CMCtKgV0bk1lwR4tWK3W/blobs/8S14enHn707yFtFxjEn5/image.png" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Whether you run a Replication Server for Rooms or for Worlds depends on [which setup you plan to use](https://docs.coherence.io/manual/replication-server/rooms-and-worlds), which in turn requires the correct corresponding [Sample UI](https://docs.coherence.io/getting-started/samples-and-tutorials/samples-connection-uis).
{% endhint %}

Regardless of how you launch it, a new terminal window will open and display the running Replication Server:

<figure><img src="https://content.gitbook.com/content/CMCtKgV0bk1lwR4tWK3W/blobs/SNaGRnOQW09nraVG27ud/image.png" alt=""><figcaption><p>The Replication Server running in the Terminal</p></figcaption></figure>

If the console opens correctly and you don't see an error line (they show up <mark style="color:red;">in red</mark>), it means your Replication Server is running! Now you should be able to connect to it, in the game.

## Run multiple instances of the game

It is often useful to be able to run multiple instances of your game on the same device. This allows you to simulate multiple player connections.

There are multiple ways to do this:

* [Make a build](https://docs.coherence.io/getting-started/setup-a-project/local-development/local-testing-using-builds) of the game
* Use the [Multiplayer Play Mode](https://docs.coherence.io/getting-started/setup-a-project/local-development/multiplayer-play-mode) package (recommended, only available in Unity 6)
* Use a third-party plugin, such as[ ParrelSync](https://docs.coherence.io/getting-started/setup-a-project/local-development/local-testing-via-parrelsync)

Dive into the individual pages to see our recommendation for each option.

## Connect to the Replication Server

Connecting is done using our API. For now, use one of the Sample UIs we provide. You should already have one in the scene if you followed the steps in the [Scene Setup](https://docs.coherence.io/getting-started/scene-setup#id-3.-add-a-connect-dialog-ui) section.

With the game and the RS running, **you can now connect** and **play the game**.

{% hint style="warning" %}
**If you can't connect**

Did you change something in the configuration of your connected Prefabs? You have to bake again, and restart the Replication Server.

You will notice it because there will be a little chef's hat next to the coherence folder, or a warning sign on Bake buttons:\
\ <img src="https://content.gitbook.com/content/CMCtKgV0bk1lwR4tWK3W/blobs/e99e3yPfBWNpB60L2Rtd/Chef.png" alt="" data-size="original">

<img src="https://content.gitbook.com/content/CMCtKgV0bk1lwR4tWK3W/blobs/QyaAGrteKF0WqXddxVsH/Bake.png" alt="" data-size="original">

\
Time to bake!
{% endhint %}

***

{% hint style="success" %}
**In this section, we:**

* Ran a local Replication Server
* Saw how to run multiple instances of the game
* Connected to the Replication Server

Now that we know things work locally, it's time to [test the game in the coherence Cloud](https://docs.coherence.io/getting-started/setup-a-project/test-in-the-cloud)!
{% endhint %}
