In this section, we will create a new script and attach it to our HUD's health bar. We will edit the script and use it to manage our Cucumber Man's health and the visible status of the HUD's health bar.
Let's start by reviewing our health bar:
- In the Hierarchy panel, select the HUD_Canvas | Health_Slider.
- In the Inspector panel, review the Slider (Script) component. As you can see in the following screenshot, there is a Value component with a slider at the bottom of the interface:
- Click the Game view tab so you can see the HUD without being in game-mode.
- In the Inspector panel, drag the Value slider and observe ...