RealDocs

UAbilitySystemComponent::ConfirmAbilityTargetData

function GameplayAbilities Since 4.15
#include "AbilitySystemComponent.h"
Access: public Specifiers: virtual

Description

Stores the incoming target data and fires the TargetDataSet delegate so ability tasks waiting on target data can proceed. Called by the server-side RPC handler after receiving replicated targeting information from the client.

Caveats & Gotchas

  • Overriding this without calling Super will silently swallow all target data — the targeting tasks that bound to the TargetDataSet delegate will never unblock.
  • Target data is cached in AbilityTargetDataMap; you must call ConsumeAllReplicatedData or ConsumeClientReplicatedTargetData after processing to prevent unbounded memory growth.

Signature

UE_API virtual void ConfirmAbilityTargetData(FGameplayAbilitySpecHandle AbilityHandle, FPredictionKey AbilityOriginalPredictionKey, const FGameplayAbilityTargetDataHandle& TargetData, const FGameplayTag& ApplicationTag)

Parameters

Name Type Description Default
AbilityHandle FGameplayAbilitySpecHandle Handle identifying the ability being confirmed.
AbilityOriginalPredictionKey FPredictionKey The prediction key used when the ability originally activated.
TargetData const FGameplayAbilityTargetDataHandle& The target data payload being confirmed (hit results, actors, locations).
ApplicationTag const FGameplayTag& Tag describing how the target data should be applied (can be empty).

Return Type

void

Example

Override to validate target data server-side C++
void UMyASC::ConfirmAbilityTargetData(
    FGameplayAbilitySpecHandle Handle, FPredictionKey PredKey,
    const FGameplayAbilityTargetDataHandle& TargetData,
    const FGameplayTag& Tag)
{
    // Validate server-side before accepting
    if (IsTargetDataValid(TargetData))
    {
        Super::ConfirmAbilityTargetData(Handle, PredKey, TargetData, Tag);
    }
}

Version History

Introduced in: 4.15

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.