RealDocs

UAbilitySystemComponent::ServerSetReplicatedTargetDataCancelled

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

Description

Reliable server RPC that notifies the server the player cancelled targeting. Fires the target data cancelled delegate and allows the server to end the targeting phase.

Caveats & Gotchas

  • No target data payload is sent — cancel carries only prediction keys to identify the correct ability activation to clean up.
  • If server-side logic already applied predicted effects based on anticipated target data, those effects must be rolled back separately; this RPC only signals the cancel, it does not undo anything.

Signature

void ServerSetReplicatedTargetDataCancelled(FGameplayAbilitySpecHandle AbilityHandle, FPredictionKey AbilityOriginalPredictionKey, FPredictionKey CurrentPredictionKey)

Parameters

Name Type Description Default
AbilityHandle FGameplayAbilitySpecHandle Handle to the ability spec whose targeting was cancelled.
AbilityOriginalPredictionKey FPredictionKey The prediction key active when the ability was activated.
CurrentPredictionKey FPredictionKey The prediction key active at the time of cancellation.

Return Type

void

Example

Sending a cancel from a custom targeting task C++
// Called when the player presses the cancel button during targeting:
ASC->ServerSetReplicatedTargetDataCancelled(
    AbilityHandle,
    OriginalPredictionKey,
    CurrentPredictionKey);

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.