> 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/utilities/player-data-container.md).

# Player Data Container

All the information that Convai SDK needs from the player to work properly

This is a scriptable object which is made automatically after you hit play in the editor with Convai SDK installed and in a Scene where Convai Base Scene Essentials Prefab is present

<figure><img src="https://413558230-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2FOSvFzJDyZpU16hymw6nR%2Fimage.png?alt=media&amp;token=7c496c6a-bce7-42b6-8ae4-7fa05a562858" alt=""><figcaption></figcaption></figure>

**Default Player Name**

You can provide a default name of your players.

**Player Name**

Current name of your player, out of the box if you use our settings panel, we keep it updated automatically, if you are using some custom logic, it will be your responsibility to keep it updated, as our transcript UI use this name to show it in UI

**Speaker ID**

Speaker ID for the player. **Please note that Speaker ID is directly linked with your API key, so for each API key there should be a unique speaker ID associated with it.** We handle the creation of the Speaker ID when it's not found in the Player Prefs if the Boolean is set to true.

**Create Speaker ID If Not Found**

This Boolean lets the SDK if it should create a unique Speaker ID for that Player Name if it is not found in the Player Prefs.

### Buttons

#### **Reset Data**

It just makes the **Player Name** and **Speaker ID** fields empty.

#### **Copy Data**

Copies the data into system buffer so you can paste it anywhere for debugging purpose

#### **Player Pref Settings Button**

1. **Load:** Loads the **Player Name** and associated **Speaker ID** from the player Prefs
2. **Save:** Saves the **Player Name** and associated **Speaker ID** from the player Prefs
3. **Delete:** Deletes the **Player Name** and associated **Speaker ID** from the player Prefs

### How to maintain the Player Data

Convai provides a pre-made component which you can add to any `GameObject` to make the `PlayerDataContainer` work out of the box.

Choose an existing GameObject or create a new `GameObject` in the scene and add the `ConvaiPlayerDataHandler` component to your chosen `GameObject` and it should start working

<figure><img src="https://413558230-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2F1IGYYp4N9aRUiTfN607x%2FConvaiPlayerDataHandler%20Component.png?alt=media&amp;token=ca7a00a6-0035-4b2c-99dd-8b78ffe7370b" alt=""><figcaption></figcaption></figure>

#### Optional Step

You can also create the required Scriptable Object by going to **`Assets > Convai > Resources`** and right clicking in the project panel and navigating to **`Create > Convai > Player Data`** and name it **`ConvaiPlayerDataSO`**

<figure><img src="https://413558230-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2FF7HOi6uSxR69LGXRWJrt%2FCreating%20Player%20Data%20SO.png?alt=media&amp;token=769a7bbf-3c73-4918-9203-0f612c401cb8" alt=""><figcaption></figcaption></figure>

{% hint style="danger" %}
Make sure you name the created Scriptable Object exactly **`ConvaiPlayerDataSO`** as our system looks for this exact name
{% 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/utilities/player-data-container.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.
