Module |
|
Header |
/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Public/Abilities/GameplayAbilityTargetTypes.h |
Include |
#include "Abilities/GameplayAbilityTargetTypes.h" |
[USTRUCT](Programming/UnrealArchitecture/Reference/Structs)()
struct FGameplayAbilityTargetData
A generic structure for targeting data. We want generic functions to produce this data and other generic functions to consume this data.
We expect this to be able to hold specific actors/object reference and also generic location/direction/origin information.
Some example producers: -Overlap/Hit collision event generates TargetData about who was hit in a melee attack -A mouse input causes a hit trace and the actor infront of the crosshair is turned into TargetData -A mouse input causes TargetData to be generated from the owner's crosshair view origin/direction -An AOE/aura pulses and all actors in a radius around the instigator are added to TargetData -Panzer Dragoon style 'painting' targeting mode -MMORPG style ground AOE targeting style (potentially both a location on the ground and actors that were targeted)
Some example consumers: -Apply a GameplayEffect to all actors in TargetData -Find closest actor from all in TargetData -Call some function on all actors in TargetData -Filter or merge TargetDatas -Spawn a new actor at a TargetData location
Maybe it is better to distinguish between actor list targeting vs positional targeting data? -AOE/aura type of targeting data blurs the line
Name | Description | |
---|---|---|
|
~FGameplayAbilityTargetData() |
Name | Description | ||
---|---|---|---|
|
AddTargetDataToContext ( |
Modifies the context and adds this target data to the target data handle stored within |
|
|
AddTargetDataToGameplayCueParameters ( |
Modifies the cue parameters and adds this target data to the target data handle stored within |
|
|
ApplyGameplayEffect ( |
Applies a gameplay effect to each target represented |
|
|
ApplyGameplayEffectSpec ( |
Applies a previously created gameplay effect spec to each target represented |
|
|
GetActors() |
Returns all actors targeted, almost always overridden |
|
|
GetEndPoint() |
Override to return a target/end point |
|
|
GetEndPointTransform() |
Override to return a transform, default will create one from just the location |
|
|
const FHitRe... |
GetHitResult() |
Override to return a hit result |
|
GetOrigin() |
Override to return an origin point, which may be derived from other data |
|
|
UScriptStruc... |
GetScriptStruct() |
Returns the serialization data, must always be overridden |
|
HasEndPoint() |
Override to true if GetEndPoint/Transform will work |
|
|
HasHitResult() |
Return true in subclasses if GetHitResult will work |
|
|
HasOrigin() |
Override to true if GetOrigin will work |
|
|
ReplaceHitWith ( |
||
|
SetActors ( |
Modify the actor list |
|
|
ShouldCheckForTargetActorSwap() |
See notes on delegate definition FOnTargetActorSwapped |
|
|
ToString() |
Returns a debug string representation |