# Wait Actions when typing

<mark style="background-color:yellow;">**You can perform actions once the typewriter reaches a specific position in the text**</mark>. *For this reason, actions work only if the typewriter is enabled.*

Example: waiting for X seconds or waiting for the player input.

***

## How to add actions in your text <a href="#how-to-add-actions-in-your-text" id="how-to-add-actions-in-your-text"></a>

You can add actions to your text by using rich text tags.

Actions’ formatting follows this formula: “`<actionID>`” or “`<actionID=attribute1,attribute2,...>`” for eventual parameters/attributes (just like events/messages).

{% hint style="warning" %}
Actions tags are case insensitive, `<waitfor>` and `<waitFor>` will produce the same results.
{% endhint %}

#### Parameters <a href="#parameters" id="parameters"></a>

Actions support multiple parameters, after the ‘`=`’ sign and all separated by a `comma`.

Example: `<waitfor=1.5>` or `<playaudio=tada,laugh,dub>`

* ⚠️ Floating point numbers must use a `period`, not a `comma`.
  * ✔️ \<speed=0.5>
  * ❌ \<speed=0,5>

***

## Databases <a href="#databases" id="databases"></a>

As with Effects, you’ll find Actions stored inside their databases. You can add and remove as many as you prefer, create specific ones and also [program your own via C#](/text-animator-unity/writing-custom-classes/writing-custom-actions-c.md).

## Built-in a <a href="#built-in-actions" id="built-in-actions"></a>

You can use the following built-in actions in your text.

<table data-view="cards"><thead><tr><th></th><th></th><th>Tag</th><th>Attributes</th><th>Example</th><th data-hidden></th><th data-hidden></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Wait for Seconds</strong></td><td>Waits for X seconds before continuing to show the text</td><td>waitfor</td><td>float (wait duration)</td><td>&#x3C;waitfor=3></td><td><p></p><p></p></td><td></td><td></td></tr><tr><td><strong>Wait for Input</strong></td><td>Waits for the player input. Specific documentation here: <a data-mention href="/pages/0YwGFLF3SsYrzlUKr0BC">/pages/0YwGFLF3SsYrzlUKr0BC</a></td><td>waitinput</td><td>Based on the input. <a href="/pages/0YwGFLF3SsYrzlUKr0BC">Read more here</a>.</td><td>&#x3C;waitinput></td><td><p></p><p></p></td><td></td><td><a href="/pages/0YwGFLF3SsYrzlUKr0BC">/pages/0YwGFLF3SsYrzlUKr0BC</a></td></tr><tr><td><strong>Speed</strong></td><td>Multiplies the typewriter speed</td><td>speed</td><td>float (speed multiplier)</td><td>&#x3C;speed =2></td><td></td><td></td><td></td></tr></tbody></table>

## Component Actions

Some actions are available only if they exist on scene (you need to create them as components).

<table data-view="cards"><thead><tr><th></th><th></th><th>Tag</th><th>Attributes</th><th>Example</th><th data-hidden></th><th data-hidden></th></tr></thead><tbody><tr><td><strong>Play Sound</strong></td><td>Plays an Audio Source (referenced in the inspector) and waits until it finishes</td><td>psound</td><td>N/A</td><td>&#x3C;psound></td><td><p></p><p></p></td><td></td></tr></tbody></table>

### Local Actions

You can make an action *local*, meaning it is only recognized if you create them next to a Typewriter Component. (only works for **TextMeshPro**)

<figure><img src="/files/5UWlqUWM60AvIi7er19e" alt=""><figcaption></figcaption></figure>

### Global Actions

Global actions are accessed by any Typewriter currently typing on scene, as long as you set "Make Available Globally" to ON.


---

# 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.febucci.com/text-animator-unity/typewriter/wait-actions-when-typing.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.
