GameplayTasks API – Making things happen with GameplayTasks

GameplayTasks are used to wrap up some gameplay functionality in a reusable object. All you have to do to use them is derive from the UGameplayTask base class and override some of the member functions that you prefer to implement.

Getting ready

Go in the UE4 Editor and navigate to Class Viewer. Ensure that you have linked in the GameplayTasks API into your ProjectName.Build.cs file and search with Actors Only tickbox off for the GameplayTask object type.

How to do it…

  1. Ensure that you have linked GameplayTasks API into your ProjectName.Build.cs file.
  2. Click on File | Add C++ Class… Choose to derive from GameplayTask. To do so, you must first tick Show All Classes, and then type gameplaytask ...

Get Unreal Engine 4 Scripting with C++ Cookbook 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.