> For the complete documentation index, see [llms.txt](https://black-horizon-studios.gitbook.io/emerald-ai-wiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://black-horizon-studios.gitbook.io/emerald-ai-wiki/emerald-components-optional/ui-component/setting-up-the-ui-component.md).

# Setting up the UI Component

{% hint style="warning" %}
**Important:** Ensure that you have your player set up with Emerald AI before proceeding as this is required for the UI system to work properly.
{% endhint %}

## Setting up the UI Component

After you have applied the UI Component to your AI, there are still a couple steps that need to be done in order for the UI system to detect which objects can enable the UI. This is done to optimize the AI system and to only allow the UI to be enabled when close enough to a player.

Open the UI Setup foldout and assign your player's Camera Tag, your UI Tag (typically your player's tag), and the UI Layers (typically your player's layer). Your player must be properly set up with Emerald AI for this to work. This means it needs to have an EmeraldGeneralTargetBridge or an EmeraldPlayerBridgescript (will also work if its a custom script derived from EmeraldPlayerBridge).

<figure><img src="/files/82PuwTu1fZdbKCUxkAGs" alt=""><figcaption></figcaption></figure>

Next, choose which settings/elements you want enabled. These must be enabled through each of the foldouts of the corresponding setting. For this example, the Health Bars are being enabled. Each foldout has various settings for the particular setting. The health bar setting allows users to customize the health bar sprites, colors, position, and scale.&#x20;

<figure><img src="/files/3HvsZCe86G6ZIZdTwDCV" alt=""><figcaption></figcaption></figure>

After you have chosen which setting to enable, test your AI to ensure they work. Getting near your AI should automatically enable the UI.

{% hint style="info" %}
**Note:** This will only enable the UI elements that you enabled through each foldout.
{% endhint %}

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


---

# 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://black-horizon-studios.gitbook.io/emerald-ai-wiki/emerald-components-optional/ui-component/setting-up-the-ui-component.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.
