Creating a Health/Damage system, part 1 – taking damage
Games will often need the ability to give health to players and/or enemies and players need to have the ability to gain and/or lose the health. In this recipe, it being the first of a two-part recipe, we will create the ability to take and heal damage, whereas later on in Chapter 10, User Interface, we will use the UI tools in Unreal to display this information.
Getting ready
Before we start working on this, we need to have a project created and set up for our character to actually have health and a way to damage it. Follow these steps:
First, open up the Unreal Editor by clicking on the Launch button from the Unreal Engine Launcher.
Start a new project from the Project Browser tab by selecting the New Project tab. Select Third person and make sure that With Starter Content is selected. Give the project a Name (
Cookbook_Chapter8
). Once you are done, click on Create Project.
How to do it…
Now, once the project is created, the first step here...