UGameplayTask::AddRequiredResource

Marks this task as requiring specified resource which has a number of consequences, like task not being able to run if the resource is already taken.

Choose your operating system:

Windows

macOS

Linux

References

Module

GameplayTasks

Header

/Engine/Source/Runtime/GameplayTasks/Classes/GameplayTask.h

Include

#include "GameplayTask.h"

Source

/Engine/Source/Runtime/GameplayTasks/Private/GameplayTask.cpp

Syntax

void AddRequiredResource
(
    TSubclassOf< UGameplayTaskResource > RequiredResource
)

Remarks

Marks this task as requiring specified resource which has a number of consequences, like task not being able to run if the resource is already taken.

@note Calling this function makes sense only until the task is being passed over to the GameplayTasksComponent. Once that's that resources data is consumed and further changes won't get applied