> For the complete documentation index, see [llms.txt](https://tkkoi-developer.gitbook.io/tkkoiassets/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tkkoi-developer.gitbook.io/tkkoiassets/top-down-rogue-like-engine/functionality/ui/floating-text.md).

# Floating Text

A system for displaying floating text above objects - damage, heals, currency. Configured via ScriptableObject rules without changing code.

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

{% hint style="danger" %}
Works only with objects that have a Health component or objects associated with coin pickup!
{% endhint %}

### How to add?

{% stepper %}
{% step %}

### Let's add a FloatingTextSpawner component for the player, for example

<figure><img src="/files/CpIABF1Q5bYOYk9JPaY0" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Now let's add rules for displaying text when any of the 4 actions occur - receiving damage, regeneration, picking up coins, or chasing coins

<figure><img src="/files/N5MUsMHnMbhzWrSkaHrx" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Configure a Scriptableobject for the rule&#xD;

<figure><img src="/files/gMLnwtM29yZXULohtLyl" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### If you need to create new settings, for example, different colors for enemies, you can do it here&#xD;

<figure><img src="/files/QoxxhjEM4WaV3q58kgpX" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### For quick testing, you can run the game and test this using the Health component.

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

### &#xD;

{% endstep %}
{% endstepper %}


---

# 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:

```
GET https://tkkoi-developer.gitbook.io/tkkoiassets/top-down-rogue-like-engine/functionality/ui/floating-text.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.
