O'Reilly logo

Unreal Engine 4 Scripting with C++ Cookbook by Stephen Whittle, William Sherif

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

GameplayAbilities API – Triggering an actor's gameplay abilities with game controls

The GameplayAbilities API can be used to attach C++ functions to invoke on certain button pushes, triggering the game unit to exhibit its abilities during play in response to keystroke events. In this recipe, we will show you how to do that.

Getting ready

Enumerate and describe your game character's abilities. You will need to know what your character does in response to key events to code in this recipe.

There are several objects that we need to use here; they are as follows:

  • UGameplayAbility class—this is needed to derivate the C++ class instances of the UGameplayAbility class, one derivative class for each ability.
    • Define what each ability does in .h and .cpp by ...

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