Navigation
Unreal Engine C++ API Reference > Runtime > GameplayTasks
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UActorComponent
- UGameplayTasksComponent
- UAbilitySystemComponent
- UMockGameplayTasksComponent
References
Module | GameplayTasks |
Header | /Engine/Source/Runtime/GameplayTasks/Classes/GameplayTasksComponent.h |
Include | #include "GameplayTasksComponent.h" |
Syntax
class UGameplayTasksComponent :
public UActorComponent,
public IGameplayTaskOwnerInterface,
public IVisualLoggerDebugSnapshotInterface
Remarks
The core ActorComponent for interfacing with the GameplayAbilities System
Variables
Type | Name | Description | |
---|---|---|---|
![]() |
FGameplayResourceSet | CurrentlyClaimedResources | Resources used by currently active tasks |
![]() |
TArray< TObjectPtr< UGameplayTask > > | KnownTasks | All known tasks (processed by this component) referenced for GC |
![]() |
FOnClaimedResourcesChangeSignature | OnClaimedResourcesChange | |
![]() |
TArray< FGameplayTaskEventData > | TaskEvents | Transient array of events whose main role is to avoid long chain of recurrent calls if an activated/paused/removed task wants to push/pause/kill other tasks. |
![]() |
TArray< TObjectPtr< UGameplayTask > > | TaskPriorityQueue | |
![]() |
TArray< TObjectPtr< UGameplayTask > > | TickingTasks | Array of currently active UGameplayTask that require ticking |
![]() |
uint8 | TopActivePriority | Indicates what's the highest priority among currently running tasks |
Constructors
Type | Name | Description | |
---|---|---|---|
![]() |
UGameplayTasksComponent
(
const FObjectInitializer& ObjectInitializer |
Functions
Type | Name | Description | |
---|---|---|---|
![]() |
bool | AddSimulatedTask
(
UGameplayTask* NewTask |
Add a new simulated task. |
![]() |
void | AddTaskReadyForActivation
(
UGameplayTask& NewTask |
Processes the task and figures out if it should get triggered instantly or wait based on task's RequiredResources, Priority and ResourceOverlapPolicy |
![]() ![]() |
void | DescribeSelfToVisLog
(
FVisualLogEntry* Snapshot |
|
![]() |
void | EndAllResourceConsumingTasksOwnedBy
(
const IGameplayTaskOwnerInterface& TaskOwner |
|
![]() ![]() |
bool | FindAllResourceConsumingTasksOwnedBy
(
const IGameplayTaskOwnerInterface& TaskOwner, |
|
![]() ![]() |
UGameplayTask * | FindResourceConsumingTaskByName
(
const FName TaskInstanceName |
Finds first resource-consuming task of given name |
![]() ![]() |
FGameplayResourceSet | ||
![]() ![]() |
GameplayTaskContainerType::TConstIterator | ||
![]() ![]() |
FString | ||
![]() ![]() |
GameplayTaskContainerType::TConstIterator | ||
![]() ![]() ![]() |
bool | Retrieves information whether this component should be ticking taken current activity into consideration | |
![]() ![]() |
GameplayTaskContainerType::TConstIterator | ||
![]() |
const TArray< UGameplayTask * > & | Tasks that run on simulated proxies | |
![]() ![]() |
FString | ||
![]() ![]() |
FString | GetTaskStateName
(
EGameplayTaskState Value |
|
![]() ![]() |
GameplayTaskContainerType::TConstIterator | ||
![]() ![]() |
FString | ||
![]() ![]() |
bool | HasActiveTasks
(
UClass* TaskClass |
|
![]() ![]() |
EGameplayTaskRunResult | K2_RunGameplayTask
(
TScriptInterface< IGameplayTaskOwnerInterface > TaskOwner, |
|
![]() |
void | OnRep_SimulatedTasks
(
const TArray< UGameplayTask* >& PreviousSimulatedTasks |
|
![]() |
void | ||
![]() |
void | RemoveResourceConsumingTask
(
UGameplayTask& Task |
|
![]() |
void | RemoveSimulatedTask
(
UGameplayTask* NewTask |
Remove an existing simulated task |
![]() |
void | ||
![]() ![]() |
EGameplayTaskRunResult | RunGameplayTask
(
IGameplayTaskOwnerInterface& TaskOwner, |
|
![]() |
void | SetCurrentlyClaimedResources
(
FGameplayResourceSet NewClaimedSet |
|
![]() |
void | SetSimulatedTasks
(
const TArray< UGameplayTask* >& NewSimulatedTasks |
Remove all current tasks and register the one in the passed array. |
![]() |
void | ||
![]() |
void |
Overridden from UActorComponent
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
void | ReadyForReplication gets called on replicated components when their owning actor is officially ready for replication. | |
![]() ![]() |
bool | ReplicateSubobjects
(
UActorChannel* Channel, |
Allows a component to replicate other subobject on the actor. |
![]() ![]() |
void | TickComponent
(
float DeltaTime, |
Function called every frame on this ActorComponent. |
Overridden from UObject
Type | Name | Description | |
---|---|---|---|
![]() ![]() ![]() |
void | GetLifetimeReplicatedProps
(
TArray< FLifetimeProperty >& OutLifetimeProps |
Returns properties that are replicated for the lifetime of the actor channel |
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) |
![]() ![]() ![]() |
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 | OnGameplayTaskActivated
(
UGameplayTask& Task |
Notify called after GameplayTask changes state to Active (initial activation or resuming) |
![]() ![]() |
void | OnGameplayTaskDeactivated
(
UGameplayTask& Task |
Notify called after GameplayTask changes state from Active (finishing or pausing) |
Overridden from IVisualLoggerDebugSnapshotInterface
Type | Name | Description | |
---|---|---|---|
![]() ![]() ![]() |
void | GrabDebugSnapshot
(
FVisualLogEntry* Snapshot |
Classes
Type | Name | Description | |
---|---|---|---|
![]() |
FEventLock |
Typedefs
Name | Description |
---|---|
GameplayTaskContainerType |
Deprecated Functions
Type | Name | Description | |
---|---|---|---|
![]() |
TArray< TObjectPtr< UGameplayTask > > & | This will be removed in future versions. Use AddSimulatedTask or RemoveSimulatedTask to modify the array |