> For the complete documentation index, see [llms.txt](https://docs.stixgames.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stixgames.com/text-animations/animations/changing-text-mid-animation.md).

# Changing Text Mid-Animation

By default animated text elements reset their animation whenever you change the value of `.text` . To create a continuous animation while changing text it's possible to use the `SetTime()` function to manually manage the animation progress.

### Example

The following script pauses the text element, which keeps it from advancing the internal timer on its own, then it manually sets the time each frame.

```csharp
using TextAnimationsForUIToolkit;
using UnityEngine;
using UnityEngine.UIElements;

public class ChangeTextMidAnimation : MonoBehaviour
{
    public UIDocument uiDocument;

    private IAnimatedTextElement _element;
    private float _startTime;

    private void Start()
    {
        _element = TextAnimationUtility.GetAnimatedTextElement(uiDocument, "animated-timer");

        // Stop the visual element from automatically advancing time
        _element.Pause();
        _startTime = Time.time;
    }

    private void Update()
    {
        var currentTime = Time.time - _startTime;
        _element.text = $"<wave>Timer: {currentTime:F}</wave>";
        _element.SetTime(currentTime);
    }
}
```

{% hint style="warning" %}
Note that using `.SetTime` to manually manage an animation currently does not support [Events](/text-animations/events/events.md). If you need both of these features combined, please contact me via the [contact form](https://stixgames.com/contact/), or join my [Discord](https://discord.gg/jvBFhQA)!
{% endhint %}
