# Objectives

### Adding New Objectives

1. Select or create a new **Objectives** asset. In the desired folder, right-click and select **Create -> UHFPS -> Game -> Objectives Asset.**
2. Add a new objective to the **Objectives** list. Each objective consists of sub-objectives, so make sure to add a new sub-objectives into the **Sub Objectives** list.

<figure><img src="/files/IdN9BXDMFORwVOTy52hf" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
You can specify how many times the objective must be completed by setting the **Complete Count**.
{% endhint %}

{% hint style="info" %}
To display the objective complete count progress, add the <mark style="color:orange;">**\[count]**</mark> selector to the sub-objective text.
{% endhint %}

<figure><img src="/files/BAOnOJoWAgZF8YTuCuYo" alt=""><figcaption></figcaption></figure>

3. Assign the objectives asset to the **Objective Manager** component, which can be found in the **GAMEMANAGER**.

<figure><img src="/files/di25baYLjey9QQ8rxcrr" alt=""><figcaption></figcaption></figure>

4. To trigger an objective, add an **Objective Trigger** component to the corresponding object. You can activate the objective via the **Trigger**, **Interact**, or **Event**.

<figure><img src="/files/ZSVNog7Ipz9h5R3G6JzV" alt=""><figcaption></figcaption></figure>

5. To assign an objective, click on the link icon located on the right side of the objective block.

<figure><img src="/files/sTqRsqskSVF9fRc4k0Q8" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
You can assign multiple sub-objectives from the same base objective, that will be activated.
{% endhint %}

6. To activate an objective via an event, set the **Trigger Type** to **Event**. Then, simply call the <mark style="color:blue;">**TriggerObjective()**</mark> method to activate the objective. You can call this method, for example, by adding the **On Take Event** when picking up an object.

<figure><img src="/files/cEXcGmHpp5hUDGsJtDVi" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Another option is to set the **Trigger Type** to **Interact** along with an **Interactable Item** added to the object. In this case, both components will be interacted with.
{% endhint %}


---

# 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.twgamesdev.com/uhfps/guides/objectives.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.
