# Custom Events

You can emit custom events by using the `<event="customEvent">` tag. Adding this tag will create a `CustomEvent` with the `name` field set to "customEvent".&#x20;

For example, the following text would emit two events:

```
<event="wave">Hi! I hope you enjoy using <event="jump"><bounce>animations</bounce>
```

At the start it emits a `CustomEvent` with the name "wave", later it emits an event with the name "jump" right when the word "animations" starts to appear.

{% hint style="warning" %}
Custom events only work when you have Text Appearance enabled in your [Text Animation Settings](/text-animations/text-animation-settings.md).
{% endhint %}

## Reacting to events with the Animated Text Events component

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

You can add as many custom events as you want. Use the `On Custom Event` UnityEvent to interact with your scene.

## Reacting to events from C\#

You can add an event handler to the `customEventTriggered` event on your animated visual elements.

```csharp
var animatedLabel = uiDocument.rootVisualElement.Q<AnimatedLabel>("animated-label");
animatedLabel.customAnimationTriggered += YourEventHandler;
```


---

# 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.stixgames.com/text-animations/events/custom-events.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.
