-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Unity 5.x By Example
By :
In the previous section, we introduced the first danger and hazard to the game: a zone that can damage and potentially kill the player. As a result, their health has the potential to reduce from its starting state. It's therefore useful both to us as developers and to gamers to visualize the health status. For this reason, let's focus on rendering the player's health to the screen as a UI health bar. Figure 6.25 offers a glimpse into the future, displaying the result of our work to come:
Figure 6.25 – Preparing to create the player health bar
We'll start by configuring a canvas object that will contain our new UI.
To get started, we'll create and configure a canvas object and associated UI camera: