Member-only story
Unity Floating Text / Damage Popup Implementation Guide
If you have ever played a game before, you are likely familiar with the concept of “floating text” or damage popups. A lot, and I mean a lot of games have this UI feature, and for beginner game developers it is a great polish feature that also provides information to the player.
And you can use text popups for more than just representing damage dealt or received. Level ups, incremental growth, achievements, and more can be conveyed to the player using popup text. It is important to be wary of popup overload, however. Think Cookie Clicker, with an endless stream of “+1”s floating to the top of the screen, or MMORPGs with dozens of numbers and words floating around without any clear purpose to the uninitiated eye.
This guide will help you write your own damage popups in Unity. This guide was created against Unity 2019.4.3.f1 (the LTS at the time of writing). You will need to utilize TextMesh Pro and DoTween to complete this tutorial.
The great news is that you do not need a canvas parent to render text — have the TextMesh render directly in scene!
Creating the Text Popup Prefab
- Open up Unity and open up your project (or a new project).
- Create an empty GameObject in the Hierarchy, name if something like…