Navigation
API > API/Plugins > API/Plugins/GameplayAbilities > API/Plugins/GameplayAbilities/Abilities > API/Plugins/GameplayAbilities/Abilities/Tasks
Inheritance Hierarchy
- UObject
- IGameplayTaskOwnerInterface
- UGameplayTask
- UAbilityTask
- UAbilityTask_WaitTargetData
References
| Module | GameplayAbilities |
| Header | /Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Public/Abilities/Tasks/AbilityTask_WaitTargetData.h |
| Include | #include "Abilities/Tasks/AbilityTask_WaitTargetData.h" |
Syntax
UCLASS ()
class UAbilityTask_WaitTargetData : public UAbilityTask
Remarks
Wait for targeting actor (spawned from parameter) to provide data. Can be set not to end upon outputting data. Can be ended by task name.
WARNING: These actors are spawned once per ability activation and in their default form are not very efficient For most games you will need to subclass and heavily modify this actor, or you will want to implement similar functions in a game-specific actor or blueprint to avoid actor spawn costs This task is not well tested by internal games, but it is a useful class to look at to learn how target replication occurs
Variables
| Type | Name | Description | |
|---|---|---|---|
| FWaitTargetDataDelegate | Cancelled | ||
| TEnumAsByte< EGameplayTargetingConfirmation::Type > | ConfirmationType | ||
| FDelegateHandle | OnTargetDataReplicatedCallbackDelegateHandle | ||
| TObjectPtr< AGameplayAbilityTargetActor > | TargetActor | The TargetActor that we spawned | |
| TSubclassOf< AGameplayAbilityTargetActor > | TargetClass | ||
| FWaitTargetDataDelegate | ValidData |
Constructors
| Type | Name | Description | |
|---|---|---|---|
UAbilityTask_WaitTargetData
(
const FObjectInitializer& ObjectInitializer |
Functions
| Type | Name | Description | |
|---|---|---|---|
| bool | BeginSpawningActor
(
UGameplayAbility* OwningAbility, |
||
| void | FinalizeTargetActor
(
AGameplayAbilityTargetActor* SpawnedActor |
||
| void | FinishSpawningActor
(
UGameplayAbility* OwningAbility, |
||
| void | InitializeTargetActor
(
AGameplayAbilityTargetActor* SpawnedActor |
||
| void | OnTargetDataCancelledCallback
(
const FGameplayAbilityTargetDataHandle& Data |
The TargetActor we spawned locally has called back with a cancel event (they still include the 'last/best' targetdata but the consumer of this may want to discard it) | |
| void | OnTargetDataReadyCallback
(
const FGameplayAbilityTargetDataHandle& Data |
The TargetActor we spawned locally has called back with valid target data | |
| void | OnTargetDataReplicatedCallback
(
const FGameplayAbilityTargetDataHandle& Data, |
Valid TargetData was replicated to use (we are server, was sent from client) | |
| void | Client canceled this Targeting Task (we are the server) | ||
| void | |||
| bool | |||
| bool | |||
| UAbilityTask_WaitTargetData * | WaitTargetData
(
UGameplayAbility* OwningAbility, |
Spawns target actor and waits for it to return valid data or to be canceled. | |
| UAbilityTask_WaitTargetData * | WaitTargetDataUsingActor
(
UGameplayAbility* OwningAbility, |
Uses specified target actor and waits for it to return valid data or to be canceled. |
Overridden from UGameplayTask
| 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 | Called when the ability is asked to cancel from an outside node. | ||
| void | ExternalConfirm
(
bool bEndTask |
Called when the ability is asked to confirm from an outside node. | |
| void | OnDestroy
(
bool AbilityEnded |
End and CleanUp the task - may be called by the task itself or by the task owner if the owner is ending. |