# Narrative Design Keys

We will create a simple scenario where the character welcomes the player and asks them about their evening or morning based on the player's time of day.

### Step 1

Activate the Narrative Design for your character in the Playground. Then, create a new Section.

### Step 2

In the Objective section of the new Section, add the following text:

`The time of day currently is {TimeOfDay}. Welcome the player and ask him how his {TimeOfDay} is going.`

{% hint style="warning" %}
Notice that any string placed between curly brackets becomes a variable. In this case, we are adding the time of day as a variable. From Unity, we can pass either the word "Morning" or "Evening," and the character will respond accordingly.
{% endhint %}

<figure><img src="https://413558230-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2FgZ8ofGMLxuNlhdl8th2E%2Fimage.png?alt=media&#x26;token=76313e0d-729d-4a92-ad1f-997149264090" alt=""><figcaption></figcaption></figure>

### Step 3

Now, let’s back to Unity and make the necessary adjustments. Click on your NPC.

Click the **Add Component** button and add the **Narrative Design Key Controller** Component.

### Step 4

In the **Name** field, enter **TimeOfDay**. In the **Value** field, specify the corresponding value for that variable, which could be **Morning**, **Evening**, or anything else you choose.

<figure><img src="https://413558230-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2FH5GYYl95BIFlKqFB7W28%2FUnity_ND_Keys.png?alt=media&#x26;token=e87cf62f-6f21-4fe0-b7c2-0e29234efe5e" alt=""><figcaption></figcaption></figure>

That’s it! Now let’s test it out. :tada::sunglasses:

<figure><img src="https://413558230-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2FomZWUaOKtAVd5M4NrO50%2FUnity_ND_Keys_Test.png?alt=media&#x26;token=36b4950c-2f19-45b9-a126-991ee01c243e" alt=""><figcaption></figcaption></figure>


---

# 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.convai.com/api-docs/plugins-and-integrations/unity-plugin/adding-narrative-design-to-your-character/narrative-design-keys.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.
