> 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

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="/files/AKeQmWYxFbrjhdPttq3u" 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="/files/oSbAdDzYL5pKFuRrkSaA" 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="/files/jW26giiSuCm2KcFbUdSc" 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 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/utilities/player-data-container.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.
