Remember to make your UI text container wide

I just spent an hour trying to figure out why ‘Time remaining’ UI element wasn’t displaying the countdown digits… I could see the ‘Time remaining:’ label, but no numbers. Double-checked the code, double-checked that the scripts were attached to the game objects correctly…

I finally realized it was because the text box in the Unity editor wasn’t wide enough: since the counter is many decimal places long, it looks like if it gets cut off partway, the whole float just fails to display at all.

So make sure it has enough space like this:

Had the same issue. Thanks for mentioning!

1 Like

You can also format the number for friendly display

levelManager.timeTillNextLevel.ToString("n2")
1 Like

Hi Geo,
thanks for the tip. I had the same problem, but the expansion of the Time Remaining display window solved it.
Tony

Privacy & Terms