Setting up Lives Counter for the Player

In the last article, we added a scoring mechanic with a UI display to the game. Today we’re going to be adding a UI element to keep track of our player’s lives, as you can see above.

The first step is that we need to add an Image component to our Canvas. We do this by right-clicking on Canvas in the hierarchy and selecting UI > Image.