O'Reilly logo

Unity Game Development Blueprints by John P. Doran

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding in text

In addition to placing the health bar, to get some experience using text, let's use that as well:

  1. With the Canvas object selected, create a text object by navigating to GameObject | UI | Text.
  2. Now, it may be hard to see it being added at first, so let's first change the color of the text. Select the Text object, and go to its Text component. Once there, change the Color property to white:
    Adding in text

    Note

    In the new UI system, objects are drawn in order, which means that if the text object was before the slider, the slider would cover the text. However, you can drag objects into whichever order you want.

  3. At this point, you'll notice that the text ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required