# OnCharacterWillAppear(int,MarkupParseResult,CancellationToken)

Method in [ActionMarkupHandler](https://docs.yarnspinner.dev/3.1/api/csharp/yarn.unity/yarn.unity.actionmarkuphandler)

## Summary

Called repeatedly for each visible character in the line.

```csharp
public abstract YarnTask OnCharacterWillAppear(int currentCharacterIndex, MarkupParseResult line, CancellationToken cancellationToken);
```

## Remarks

This method is a [ActionMarkupHandler](https://docs.yarnspinner.dev/3.1/api/csharp/yarn.unity/yarn.unity.actionmarkuphandler) object's main opportunity to take action during line display.

## Parameters

| Name                                                                                                            | Description                                                    |
| --------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| `int` currentCharacterIndex                                                                                     | The zero-based index of the character being displayed.         |
| text                                                                                                            | A `TMPro.TMP_Text` object that the line is being displayed in. |
| `CancellationToken` cancellationToken                                                                           | A cancellation token representing whether the                  |
| [MarkupParseResult](https://docs.yarnspinner.dev/3.1/api/csharp/yarn.markup/yarn.markup.markupparseresult) line |                                                                |

## Returns

A task that completes when the [ActionMarkupHandler](https://docs.yarnspinner.dev/3.1/api/csharp/yarn.unity/yarn.unity.actionmarkuphandler) has completed presenting this character. Dialogue presenters will wait until this task is complete before displaying the remainder of the line.


---

# 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.yarnspinner.dev/3.1/api/csharp/yarn.unity/yarn.unity.actionmarkuphandler/yarn.unity.actionmarkuphandler.oncharacterwillappear.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.
