# Text References

This component should be added to every UI GameObject that needs to display or interact with text. By default it is used for distance texts, but it can also serve as a flexible entry point for your own scripts to modify or control UI text elements.

Once the component is added, it automatically detects supported text components on the GameObject and assigns the appropriate [text adapter](/hud-navigation-system/hud-navigation-element/text-adapters.md).

The system uses [text adapters](/hud-navigation-system/hud-navigation-element/text-adapters.md) internally, allowing it to support multiple text component types without additional setup. Out of the box HNS supports legacy UI text and TextMeshPro text, but you can easily create your own [text adapters](/hud-navigation-system/hud-navigation-element/text-adapters.md).

{% hint style="info" %}
To see the component in action, check out the example prefabs:\
\&#xNAN;*Sickscore Games* > *HUD Navigation System* > *\_Examples* > *HUDPrefabs*
{% endhint %}

<figure><img src="/files/-M6LMmvRTfk3plMiogyq" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
**Important for TextMeshPro Support:**\
Depending on your version of Unity and TextMeshPro, you may need to enable support by adding `TMP_PRESENT` to your project’s scripting define symbols.

To do this, go to **Edit → Project Settings → Player**, then under **Other Settings**, locate the **Scripting Define Symbols** field. Add `TMP_PRESENT` there. If the field already contains entries, separate them with a semicolon (e.g., `EXISTING_SYMBOL;TMP_PRESENT`).
{% 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://sickscoregames.gitbook.io/hud-navigation-system/hud-navigation-element/text-references.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.
