> For the complete documentation index, see [llms.txt](https://docs.convai.com/api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.convai.com/api-docs/plugins-and-integrations/unity-plugin/setting-up-unity-plugin.md).

# Setting Up Unity Plugin

Follow these instructions to setup the Unity Plugin into your project.

{% hint style="info" %}
The file structure belongs to the Core version of the plugin downloaded from the documentation.
{% endhint %}

### Setting up Unity Plugin

In the Menu Bar, go the Convai > API Key Setup.

<figure><img src="https://413558230-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2FmzTr6EgpLD64x6u6AhXs%2Fimage.png?alt=media&amp;token=9247b33a-a696-47a7-92a0-814cd19566ed" alt=""><figcaption></figcaption></figure>

Go to [convai.com](https://convai.com), and sign in to your Convai account. Signing in will redirect you to the Dashboard. From the dashboard, grab your API key.

<figure><img src="https://413558230-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2FGbUuZB1wZAeWr8cqGf1N%2Fimage.png?alt=media&amp;token=8197ae1f-0bc3-4cc6-94d2-df5fb1e02fad" alt=""><figcaption></figcaption></figure>

<figure><img src="https://413558230-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2FUaDkwcZnZhl6vbv2c1EE%2Fimage.png?alt=media&amp;token=b6155743-5aeb-4eda-b052-429a3f8abf94" alt=""><figcaption></figcaption></figure>

Enter the API Key and click begin.

<figure><img src="https://413558230-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2FgoH9XrQ2eiAKOzbKzs4f%2Fimage.png?alt=media&amp;token=e5de12ef-bc4b-472c-af37-d595f97e4daa" alt=""><figcaption></figcaption></figure>

This will create an APIKey asset in the resources folder. This contains your API Key.

Open the demo scene by going to Convai > Demo > Scenes > Full Features

<figure><img src="https://413558230-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2FXVkMwywXPEvxZlK8PVAo%2Fimage.png?alt=media&amp;token=b4997d10-d2eb-4291-b792-0275967f7c20" alt=""><figcaption></figcaption></figure>

Click the Convai NPC Amelia and add the Character ID (or you can keep the default character ID). You can get the character ID for your custom character from this page [Broken mention](broken://pages/Q5SplR81qembnni7lWul). Now you can converse with the character. The script is set up so that you have to go near the character for them to hear you.

<figure><img src="https://413558230-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2FG36vjQFS4B9CXjvvrfZH%2Fimage.png?alt=media&amp;token=bed1bef3-e08b-434a-a4e3-1d53e95266d3" alt=""><figcaption></figcaption></figure>

Now you can test out the Convai Demo Scene and talk to the character present there. Her name is Amelia and she loves hiking!

<figure><img src="https://413558230-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2FGqMgJL3VIQDd8GkZB4wi%2Fimage.png?alt=media&amp;token=ce593e9f-44d6-4cd6-af05-4dadc1415f38" alt=""><figcaption></figcaption></figure>

You can open the Convai NPC Script to replicate or build on the script to create new NPCs.

{% hint style="warning" %}
Try to extend the ConvaiNPC.cs script instead of directly modifying it to maintain compatibility with other scripts
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.convai.com/api-docs/plugins-and-integrations/unity-plugin/setting-up-unity-plugin.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
