> 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

{% 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="/files/SCRKtQwKnc5tMtlsrqZl" 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="/files/zDArfn9rh6Q7xMnh4K0J" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/6IesbkOcSQRFZERVZlYW" alt=""><figcaption></figcaption></figure>

Enter the API Key and click begin.

<figure><img src="/files/yEZOtk5WYQexjWg1v60J" 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="/files/yvIokpzSj1iTzSGC8cBA" 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="/files/hIUfItjKJwupLzpmtGnH" 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="/files/JdHUK5Q0aQLjOhr3xI4c" 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 dynamically by asking a question.

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

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
