Dynamic enemy healthbars

Another thing that you'll often see in games are healthbars for enemies that will appear over their heads, changing as the game is being played. In this recipe, we will learn how we can do what we've learned from the previous recipe and apply it here.

Getting ready

Before we start working on this, we need to have a project created and set up. Do the previous recipe all the way to completion.

How to do it…

Of course, to actually have enemy healthbars, we will need to actually have an enemy, so let's get that implemented first:

  1. Go to the Content Browser tab and then to the ThirdPersonBP/Blueprints folder. Right-click on the ThirdPersonCharacter object and then select Duplicate and name the duplicated object AI.
  2. Double-click

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.