Creating a Health/Damage system, part 2 – creating a healthbar

Something that you'll be using often as a game developer is some kind of healthbar. In this recipe, we will learn how to display a healthbar on the screen that will update based off of the values of variables inside of blueprints.

Getting ready

Before we start working on this, we need to have a project created and set up for our character. To do this, complete the Creating a Health/Damage system, part 1 – taking damage recipe in Chapter 8, Blueprint Scripting – Level Effects.

How to do it…

Let's see how we can use the UMG editor to display a healthbar:

  1. From the Content Browser tab, select the Content folder and then click on the Add New button and select New Folder. Name this new folder ...

Get Unreal Engine: Game Development from A to Z now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.