Performance Optimization Guide

Text Animations will likely not be a significant performance cost in your project. In case you should still run into problems, this guide may help you with your problems.

If you still have performance after reading this guide, make sure to contact me via my support email, the contact form, or on my Discord.

Keep your text short

You should only animate short pieces of text. Instead of animating a large section at once, show the text sentence by sentence. If you can't avoid animating a large text, you could inline an Animated Visual Elements into a larger text, or split the large text into multiple smaller animated text elements that get shown with a delay, instead of putting the whole text into a single Animated Visual Elements.

Most of the performance cost will occur when you set the text property of the animated text element. Your text gets parsed (searching for tags in the text) and Labels are created for each letter. Text Animations for UI Toolkit tries to reuse visual elements, so the first call will most likely be the most performance costly one.

Reduce the animation framerate

If you haven't already done so, create a Text Animation Settings object in your project folder (Create > Stix Games > Text Animations for UI Toolkit). Add the settings object to your Animated Text Element in UI builder or via script.

You can change the Target Frame Rate in the Performance section of the Text Animation Settings object. A lower target frame rate means the text is updated less frequently, improving performance.

Make sure to add the Text Animation Settings object to your animated text elements (in UI builder or via script) or the settings will be ignored!

Last updated

Was this helpful?