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.
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.
Ensure that you have linked
GameplayTasks
API into yourProjectName.Build.cs
file.Click on File | Add C++ Class… Choose to derive from
GameplayTask
. To do so, you must first tick Show All Classes, and then typegameplaytask
into the filter box. Click on Next, name your C++ class (something likeGameplayTask_TaskName
is the convention) then add the class to your project. The example spawns a particle emitter and is calledGameplayTask_CreateParticles
.