UAbilityTask_WaitTargetData

Wait for targeting actor (spawned from parameter) to provide data.

Windows
MacOS
Linux

Inheritance Hierarchy

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](Programming/UnrealArchitecture/Reference/Classes#classdeclaration)(NotPlaceable)
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

Name Description

Public variable UProperty BlueprintAssignable

FWaitTargetData ...

 

Cancelled

Protected variable

TEnumAsByte < EG ...

 

ConfirmationType

Protected variable

FDelegateHandle

 

OnTargetDataReplicatedCallbackDelegateHandle

Protected variable UProperty

AGameplayAbilit ...

 

TargetActor

The TargetActor that we spawned

Protected variable UProperty

TSubclassOf < AG ...

 

TargetClass

Public variable UProperty BlueprintAssignable

FWaitTargetData ...

 

ValidData

Constructors

Name Description

Public function

UAbilityTask_WaitTargetData

(
    const FObjectInitializer & ObjectIn...
)

Functions

Name Description

Public function UFunction BlueprintCallable, Category, Meta

bool

 

BeginSpawningActor

(
    UGameplayAbility * OwningAbilit...,
    TSubclassOf < AGameplayAbilityTarget ...,
    AGameplayAbilityTargetActor *& ...
)

Protected function Const

void

 

FinalizeTargetActor

(
    AGameplayAbilityTargetActor * S...
)

Public function UFunction BlueprintCallable, Category, Meta

void

 

FinishSpawningActor

(
    UGameplayAbility * OwningAbilit...,
    AGameplayAbilityTargetActor * S...
)

Protected function Const

void

 

InitializeTargetActor

(
    AGameplayAbilityTargetActor * S...
)

Public function UFunction

void

 

OnTargetDataCancelledCallback

(
    const FGameplayAbilityTargetDataHan ...
)

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)

Public function UFunction

void

 

OnTargetDataReadyCallback

(
    const FGameplayAbilityTargetDataHan ...
)

The TargetActor we spawned locally has called back with valid target data

Public function UFunction

void

 

OnTargetDataReplicatedCallback

(
    const FGameplayAbilityTargetDataHan ...,
    FGameplayTag ActivationTag
)

Valid TargetData was replicated to use (we are server, was sent from client)

Public function UFunction

void

 

OnTargetDataReplicatedCancelledCallback()

Client canceled this Targeting Task (we are the server)

Protected function

void

 

RegisterTargetDataCallbacks()

Protected function Const

bool

 

ShouldReplicateDataToServer()

Protected function Const

bool

 

ShouldSpawnTargetActor()

Public function Static UFunction BlueprintCallable, Category, Meta

UAbilityTask ...

 

WaitTargetData

(
    UGameplayAbility * OwningAbilit...,
    FName TaskInstanceName,
    TEnumAsByte < EGameplayTargetingConf ...,
    TSubclassOf < AGameplayAbilityTarget ...
)

Spawns target actor and waits for it to return valid data or to be canceled.

Public function Static UFunction BlueprintCallable, Category, Meta

UAbilityTask ...

 

WaitTargetDataUsingActor

(
    UGameplayAbility * OwningAbilit...,
    FName TaskInstanceName,
    TEnumAsByte < EGameplayTargetingConf ...,
    AGameplayAbilityTargetActor * T...
)

Uses specified target actor and waits for it to return valid data or to be canceled.

Overridden from UGameplayTask

Name Description

Public function Virtual

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

Public function Virtual

void

 

ExternalCancel()

Called when the ability is asked to cancel from an outside node.

Public function Virtual

void

 

ExternalConfirm

(
    bool bEndTask
)

Called when the ability is asked to confirm from an outside node.

Protected function Virtual

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.

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback