Navigation
Unreal Engine C++ API Reference > Runtime > GameplayTasks
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UGameplayTask
- UAbilityTask
- UAbilityTask_ApplyRootMotion_Base
- UAbilityTask_ApplyRootMotionConstantForce
- UAbilityTask_ApplyRootMotionJumpForce
- UAbilityTask_ApplyRootMotionMoveToActorForce
- UAbilityTask_ApplyRootMotionMoveToForce
- UAbilityTask_ApplyRootMotionRadialForce
- UAbilityTask_MoveToLocation
- UAbilityTask_NetworkSyncPoint
- UAbilityTask_PlayMontageAndWait
- UAbilityTask_Repeat
- UAbilityTask_SpawnActor
- UAbilityTask_StartAbilityState
- UAbilityTask_VisualizeTargeting
- UAbilityTask_WaitAbilityActivate
- UAbilityTask_WaitAbilityCommit
- UAbilityTask_WaitAttributeChange
- UAbilityTask_WaitAttributeChangeRatioThreshold
- UAbilityTask_WaitAttributeChangeThreshold
- UAbilityTask_WaitCancel
- UAbilityTask_WaitConfirm
- UAbilityTask_WaitConfirmCancel
- UAbilityTask_WaitDelay
- UAbilityTask_WaitGameplayEffectApplied
- UAbilityTask_WaitGameplayEffectApplied_Self
- UAbilityTask_WaitGameplayEffectApplied_Target
- UAbilityTask_WaitGameplayEffectBlockedImmunity
- UAbilityTask_WaitGameplayEffectRemoved
- UAbilityTask_WaitGameplayEffectStackChange
- UAbilityTask_WaitGameplayEvent
- UAbilityTask_WaitGameplayTag
- UAbilityTask_WaitGameplayTagAdded
- UAbilityTask_WaitGameplayTagRemoved
- UAbilityTask_WaitGameplayTagQuery
- UAbilityTask_WaitInputPress
- UAbilityTask_WaitInputRelease
- UAbilityTask_WaitMovementModeChange
- UAbilityTask_WaitOverlap
- UAbilityTask_WaitTargetData
- UAbilityTask_WaitVelocityChange
- UAITask
- UAITask_LockLogic
- UAITask_MoveTo
- UAITask_RunEQS
- UAITask_UseGameplayBehaviorSmartObject
- UGameplayTask_ClaimResource
- UGameplayTask_SpawnActor
- UGameplayTask_TimeLimitedExecution
- UGameplayTask_WaitDelay
- UMockTask_Log
References
Module | GameplayTasks |
Header | /Engine/Source/Runtime/GameplayTasks/Classes/GameplayTask.h |
Include | #include "GameplayTask.h" |
Syntax
class UGameplayTask :
public UObject,
public IGameplayTaskOwnerInterface
Variables
Type | Name | Description | |
---|---|---|---|
![]() |
uint32: 1 | bCaresAboutPriority | |
![]() |
uint32: 1 | bClaimRequiredResources | |
![]() |
uint32: 1 | bIsPausable | |
![]() |
uint32: 1 | bIsSimulating | Am I actually running this as a simulated task. |
![]() |
uint32: 1 | bOwnedByTasksComponent | This is set to avoid duplicate calls to task's owner and TasksComponent when both are the same object |
![]() |
uint32: 1 | bOwnerFinished | |
![]() |
uint32: 1 | bSimulatedTask | Should this task run on simulated clients? This should only be used in rare cases, such as movement tasks. |
![]() |
uint32: 1 | bTickingTask | If true, this task will receive TickTask calls from TasksComponent |
![]() |
TObjectPtr< UGameplayTask > | ChildTask | Child task instance |
![]() |
FGameplayResourceSet | ClaimedResources | Resources that are going to be locked when this task gets activated, but are not required to get this task started |
![]() |
FString | DebugDescription | |
![]() |
FName | InstanceName | This name allows us to find the task later so that we can end it. |
![]() |
uint8 | Priority | This controls how this task will be treated in relation to other, already running tasks, provided GameplayTasksComponent is configured to care about priorities (the default behavior) |
![]() |
FGameplayResourceSet | RequiredResources | Abstract "resource" IDs this task needs available to be able to get activated. |
![]() |
ETaskResourceOverlapPolicy | ResourceOverlapPolicy | |
![]() |
TWeakInterfacePtr< IGameplayTaskOwnerInterface > | TaskOwner | Task Owner that created us |
![]() |
TWeakObjectPtr< UGameplayTasksComponent > | TasksComponent | |
![]() |
EGameplayTaskState | TaskState | You should never access it directly. |
Constructors
Type | Name | Description | |
---|---|---|---|
![]() |
UGameplayTask
(
const FObjectInitializer& ObjectInitializer |
Functions
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
void | Activate () |
Called to trigger the actual task once the delegates have been set up Note that the default implementation does nothing and you don't have to call it |
![]() |
void | AddClaimedResource
(
TSubclassOf< UGameplayTaskResource > ClaimedResource |
|
![]() |
void | ||
![]() |
void | AddClaimedResourceSet
(
const TArray< TSubclassOf< UGameplayTaskResource > >& AdditionalResourcesToClaim |
|
![]() |
void | AddClaimedResourceSet
(
FGameplayResourceSet AdditionalResourcesToClaim |
|
![]() |
void | ||
![]() |
void | AddRequiredResource
(
TSubclassOf< UGameplayTaskResource > RequiredResource |
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. |
![]() |
void | AddRequiredResourceSet
(
const TArray< TSubclassOf< UGameplayTaskResource > >& RequiredResourceSet |
|
![]() |
void | AddRequiredResourceSet
(
FGameplayResourceSet RequiredResourceSet |
|
![]() ![]() |
IGameplayTaskOwnerInterface * | ConvertToTaskOwner
(
UObject& OwnerObject |
|
![]() ![]() |
IGameplayTaskOwnerInterface * | ConvertToTaskOwner
(
AActor& OwnerActor |
|
![]() |
void | EndTask () |
Called explicitly to end the task (usually by the task itself). |
![]() ![]() |
void | Called when the task is asked to cancel from an outside node. | |
![]() ![]() |
void | ExternalConfirm
(
bool bEndTask |
Called when the task is asked to confirm from an outside node. |
![]() ![]() ![]() |
FString | ||
![]() ![]() |
AActor * | Proper way to get the avatar actor associated with the task owner (usually a pawn, tower, etc) | |
![]() ![]() |
UGameplayTask * | GetChildTask () |
|
![]() ![]() |
FGameplayResourceSet | ||
![]() ![]() |
const FString & | ||
![]() ![]() ![]() |
FString | Return debug string describing task | |
![]() |
UGameplayTasksComponent * | ||
![]() ![]() |
UGameplayTasksComponent * | ||
![]() ![]() |
FName | ||
![]() ![]() |
AActor * | Proper way to get the owning actor of task owner. | |
![]() ![]() |
uint8 | GetPriority () |
|
![]() ![]() |
FGameplayResourceSet | ||
![]() ![]() |
ETaskResourceOverlapPolicy | ||
![]() ![]() |
EGameplayTaskState | GetState () |
|
![]() ![]() |
IGameplayTaskOwnerInterface * | GetTaskOwner () |
|
![]() ![]() |
FString | ||
![]() ![]() ![]() |
UWorld * | GetWorld () |
Helper function for getting UWorld off a task |
![]() ![]() |
bool | ||
![]() ![]() |
void | InitSimulatedTask
(
UGameplayTasksComponent& InGameplayTasksComponent |
|
![]() |
void | InitTask
(
IGameplayTaskOwnerInterface& InTaskOwner, |
Initializes the task with the task owner interface instance but does not activate until Activate() is called |
![]() ![]() |
bool | IsActive () |
|
![]() ![]() |
bool | IsFinished () |
|
![]() ![]() |
bool | ||
![]() ![]() |
bool | IsPausable () |
|
![]() ![]() |
bool | IsPaused () |
|
![]() ![]() |
bool | ||
![]() ![]() |
bool | IsSimulating () |
|
![]() ![]() |
bool | ||
![]() ![]() ![]() |
bool | ||
![]() ![]() ![]() |
bool | ||
![]() |
void | Called when a task owner wants to inform the task that it's done and don't want to get notified on task deactivation (i.e. OnGameplayTaskDeactivated). | |
![]() ![]() |
T * | NewTask
(
IGameplayTaskOwnerInterface& TaskOwner, |
|
![]() ![]() |
T * | NewTask
(
TScriptInterface< IGameplayTaskOwnerInterface > TaskOwner, |
|
![]() ![]() |
T * | Helper function for instantiating and initializing a new task | |
![]() ![]() |
T * | ||
![]() ![]() |
T * | Added for consistency with NewTask, but to indicate that a task requires manual call to InitTask This path is used to manually configure some aspects of the task, like Priority | |
![]() ![]() |
void | OnDestroy
(
bool bInOwnerFinished |
End and CleanUp the task - may be called by the task itself or by the task owner if the owner is ending. |
![]() ![]() |
void | Pause () |
Protected by design. Not meant to be called outside from GameplayTaskComponent mechanics |
![]() |
void | Called to trigger the actual task once the delegates have been set up | |
![]() ![]() |
bool | ||
![]() ![]() |
void | Resume () |
|
![]() |
void | Called when task owner has "ended" (before the task ends) kills the task. Calls OnDestroy. | |
![]() ![]() |
void | TickTask
(
float DeltaTime |
Tick function for this task, if bTickingTask == true |
Overridden from UObject
Type | Name | Description | |
---|---|---|---|
![]() ![]() ![]() |
bool | IsSupportedForNetworking means an object can be referenced over the network |
Overridden from IGameplayTaskOwnerInterface
Type | Name | Description | |
---|---|---|---|
![]() ![]() ![]() |
AActor * | GetGameplayTaskAvatar
(
const UGameplayTask* Task |
Get "body" of task's owner / default, having location in world (e.g. Owner = AIController, Avatar = Pawn) |
![]() ![]() ![]() |
uint8 | Get default priority for running a task | |
![]() ![]() ![]() |
AActor * | GetGameplayTaskOwner
(
const UGameplayTask* Task |
Get owner of a task or default one when task is null |
![]() ![]() ![]() |
UGameplayTasksComponent * | GetGameplayTasksComponent
(
const UGameplayTask& Task |
Finds tasks component for given GameplayTask, Task.GetGameplayTasksComponent() may not be initialized at this point! |
![]() ![]() |
void | OnGameplayTaskDeactivated
(
UGameplayTask& Task |
Notify called after GameplayTask changes state from Active (finishing or pausing) |
![]() ![]() |
void | OnGameplayTaskInitialized
(
UGameplayTask& Task |
Notify called after GameplayTask finishes initialization (not active yet) |
Classes
Type | Name | Description | |
---|---|---|---|
![]() |
FGenericGameplayTaskDelegate |