# 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](https://docs.stixgames.com/text-animations/text-animation-settings "mention").
{% endhint %}

## Reacting to events with the Animated Text Events component

<figure><img src="https://101455922-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsXRHzPpSiweEUfocjZwl%2Fuploads%2FqFPenuLlwW4AHlVnYtq4%2Fimage.png?alt=media&#x26;token=7b5dc937-53d3-40ef-8294-c9f701de373d" 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;
```
