# Mirror Pong

Explore how to host Unity projects on Edgegap using techniques from the [Mirror Pong Sample](https://mirror-networking.gitbook.io/docs/manual/examples/pong).

{% embed url="<https://youtu.be/bvBkObGLTMk>" %}

## ✔️ Preparation

Before we start, you will need:

* Unity 6 - [download using Unity Hub](https://unity.com/releases/unity-6),
* Mirror Unity package - [download from Unity Asset Store](https://assetstore.unity.com/packages/tools/network/mirror-129321),
  * this package includes the Pong sample.

Create a new project and import the Mirror package above.

## ⚡ Deploy and Connect

### 1. Deploy a Server on Edgegap

☑️ To get started, you'll need to [create a free account with Edgegap](https://app.edgegap.com/auth/register). No credit card required.

☑️ [Create a new app version for your application](https://app.edgegap.com/application-management/applications/mirror-pong-sample/versions/create), choose Mirror Pong Sample.

☑️ [Deploy a server with your Mirror Pong Sample app version](https://app.edgegap.com/deployment-management/deployments/list).

☑️ [Open your new deployment's details](https://app.edgegap.com/deployment-management/deployments/list).

☑️ Find your deployment's unique, one-time connection details:

* **Host URL** in format `780aa4260e83.pr.edgegap.net` ,
* **External Port** in format `30854`  (5 digits).

✅ You may now proceed to the next step.

### 2. Connect from Editor

☑️ Open your new project in Unity.

☑️ Open scene in folder Mirror / Examples / Pong / Scenes / MirrorPong.unity.

☑️ Press the ▶️ Play button to start your game client.

☑️ Input connection details from previous step.

☑️ Press Client button to connect to your server.

☑️ Connect a second virtual Player with [Multiplayer Play Mode](https://docs-multiplayer.unity3d.com/mppm/current/about/) or [ParrelSync](https://github.com/VeriorPies/ParrelSync).

🙌 Congratulations on your first Deployment on Edgegap!

## ✏️ Customize Server Build

{% hint style="success" %}
See [unity](https://docs.edgegap.com/unity "mention") for Unity to **learn how to build and customize servers**.
{% endhint %}


---

# 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.edgegap.com/docs/sample-projects/unity-netcodes/mirror-pong.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.
