# Quests

***

### Quest System

#### **Understanding the Quest System**

{% hint style="info" %}
Currently, the Quest system is unavailable for testing in Preview mode and can only be seen after clicking the Create World button in Preview mode.
{% endhint %}

In the sample app below, the trigger area is outlined in blue. Once the avatar enters the trigger area, the Quest system starts.

The first task requires the user to click the red box. Once the user clicks the red box, the first task is completed and the Quest system updates.

The second task requires the user to click multiple green boxes. Each green box that is clicked adds progress toward completing the task. Once all green boxes have been clicked, the task is completed and the Quest is finished.

If the user clicks a blue box during the quest, the Quest system resets. The user will need to re-enter the trigger area to restart the quest.

| <img src="/files/zjobgExgZmwhxFfmeAHY" alt="" data-size="original">                                              | <img src="/files/zjZIrhLJiThON9mbGvYq" alt="" data-size="original">                                                        | <img src="/files/QupkXGruFTGPTtH1fMdY" alt="" data-size="original">        |
| ---------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| The avatar enters the trigger area and the Quest system dialog appears.                                          | With the Quest system started, the user clicks on the red box and the first task is completed.                             | When the user clicks each green box, progress is added to the second task. |
| <img src="/files/D34dIxDC0j7bxKWEA3lc" alt="" data-size="original">                                              | <img src="/files/ipOLsP5HpZC7hvkJXDSL" alt="" data-size="original">                                                        |                                                                            |
| Once the user clicks on the final green box, the second task is complete and the Quest system dialog disappears. | If the user clicks on a blue box before both tasks are completed, the Quest system resets and needs to be triggered again. |                                                                            |

### How to Create a Quest System

{% stepper %}
{% step %}

#### Open Viverse Scene Settings

A. Click on the Viverse Scene Settings button.

<figure><img src="/files/ZvWbxzA7ZSddSdShQipJ" alt="" width="188"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Create the quest

A. Give the quest a name in the **Quest name** field. The text: **Find the boxes!** was added.

B. Give the quest a description in the **Quest description** field. The text: **Click on the boxes that are a specific color.** was added.

C. Create the first task and give the task a description in the **Task description** field. The text: **Click on the red box.** was added.

D. Set the **Task type** to **check**.

E. Create the second task and give the task a description in the **Task description** field. The text: **Click on the green boxes.** was added.

F. Set the **Task type** to **progressBar**.

G. Add the value **4** to the **Progress Steps** field.

<figure><img src="/files/wo4vT1Pgr9Q0OdBw7lDR" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Create the trigger area that will start the quest

A. Create a new **3D Box** entity.

B. Add a **Collision** component.

C. Adding a material is optional. A transparent material has been added so that the trigger area is visible in play mode.

D. Click the **Edit Viverse Extension** button.

<figure><img src="/files/tmjkroUXMnKwWd7RBJqS" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Starting the quest

A. In the VIVERSE extension, select the **TriggerAndAction** plugin for the **Select plugins** dropdown.

B. Add a **Trigger** and select **EntitySubscribeTriggerEnter**.

C. Add **local-player** to the **tags to filter** field.

D. Add an **Action** and select **Quest.**

E. In the **selected quest** field, choose **Find the boxes!**

F. In the **quest response** field, choose **startQuest**.

<figure><img src="/files/XAzwpExYh4sYWP1fANvV" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Create an object that can be clicked to complete the first task

A. Create a 3D object.

B. Add a **Collision** component.

C. Add a material. Red has been added because this will be the box that will be clicked on to complete the first task.

D. Click the **Edit Viverse Extension** button.

<figure><img src="/files/FeIfVKdEPNDEZlwP9Fni" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Completing the first task

A. In the VIVERSE extension, select the **TriggerAndAction** plugin for the **Select plugins** dropdown.

B. Add a **Trigger** and select **NotificationCenterSubscribeEntityPicking**.

C. Add an **Action** and select **Quest.**

D. In the **selected quest** field, choose **Find the boxes!**

E. In the **quest response** field, choose **completeTask**.

F. In the **selected task field,** choose **Click on the red box.**

<figure><img src="/files/zF0NySK5B1NUaTO1F9oi" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Create multiple objects that can be clicked to complete the second task

A. Create multiple 3D objects.

B. Add a **Collision** component to each object.

C. Add a material. Green has been added because these will be the boxes that will be clicked on to complete the second task.

D. Click the **Edit Viverse Extension** button.

<figure><img src="/files/Bfz3kWum3SYTEqCBLaX6" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Completing the second task

The following steps are completed for all green boxes.

A. In the VIVERSE extension, select the **TriggerAndAction** plugin for the **Select plugins** dropdown.

B. Add a **Trigger** and select **NotificationCenterSubscribeEntityPicking**.

C. Add an **Action** and select **Quest.**

D. In the **selected quest** field, choose **Find the boxes!**

E. In the **quest response** field, choose **addTaskProgress**.

F. In the **selected task field,** choose **Click on the green boxes.**

<figure><img src="/files/CKtIuP1mCxBFmAxnYSwA" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Create multiple objects that can be clicked to reset the quest

A. Create multiple 3D objects.

B. Add a **Collision** component to each object.

C. Add a material. Blue has been added because these will be the boxes that will be clicked on to reset the quest.

D. Click the **Edit Viverse Extension** button.

<figure><img src="/files/6zkcyuberxATwJOzto6g" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Resetting the quest

The following steps are completed for all blue boxes.

A. In the VIVERSE extension, select the **TriggerAndAction** plugin for the **Select plugins** dropdown.

B. Add a **Trigger** and select **NotificationCenterSubscribeEntityPicking**.

C. Add an **Action** and select **Quest.**

D. In the **selected quest** field, choose **Find the boxes!**

E. In the **quest response** field, choose **resetQuest**.

<figure><img src="/files/wOcmOL3THnvihMVhHlk0" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}


---

# 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.viverse.com/playcanvas-toolkit/building-with-the-playcanvas-toolkit/no-code-tools/quests.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.
