O'Reilly logo

Unreal Engine 4 Game Development Essentials by Satheesh PV

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

C++ to Blueprint

We now have a health and health regeneration system in our character class. One problem with our current system is that we have not yet defined what happens to our character after the health reaches 0. In this section, we will create an event that we will implement in Blueprint. This event will be called when the player's health reaches 0.0. To create this Blueprint event, open our character header file and add the following code:

UFUNCTION(BlueprintImplementableEvent, Category = "My Character")
void PlayerHealthIsZero();

As you can see, we added a normal function called PlayerHealthIsZero(). To make this available in Blueprint, we added a UFUNCTION specifier and inside that we added BlueprintImplementableEvent. This means C++ can ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required