What would be the best way to animate UI in Unity?

Hey, guys! I have a question with regards to animating UI in Unity.

I’ve found tutorials online recommending that it was better to animate UI in code. Rather than using the Animation System that comes with Unity, they suggested to not animate UI with that method so as not to cause performance problems since it updates the layout every single frame (even when idle). With that, the tutorials mentioned using tweening libraries such as DoTween, LeanTween, etc.

These tutorials were from 2-3 years ago. One commenter also referenced Unity 2019.3 patch notes that stated, “UI: Fixed performance issues with Animation by not dirtying the Layout if an Animation updates items.”

I would like to know your opinions on this. Based on your industry experience in shipping games and taking into account game performance and industry standard, what is the best way to animate UI?

Would you guys recommend using Tweening libraries? And if so, which libraries would be best to use? Are they safe to use and do they not cause dependency issues? Or since Unity had a fix for UI in the mentioned patch notes, would animating UI with the Animation System be good enough already?

Thank you in advance to anyone who shares their insights on this!

1 Like

Hi Joseph,

I recently used DoTween to animate UI elements. It works well, and I’ll probably keep using it in future projects.

I did not use Unity’s animation system for my GUI because it is not performant for things you want to animate occasionally only. Even the “Idle” state is constantly running.

Generally, there is no way to tell if you’ll never get any dependency issues because nobody knows what other assets you use in your game. That’s something you’ll have to figure out yourself by testing the assets.

Which of the tutorials you watched looked promising? Test the tools that were featured in the video unless you know that the tools are outdated/deprecated.

Also please feel free to ask our helpful community of students for opinions and recommendations over on our Discord chat server.


See also:

Hello, Nina!

Thank you very much for your reply.
Your suggestions and recommendations will surely be of help to me and other students!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms