UAbilitySystemComponent::AbilityTargetDataCancelledDelegate
#include "AbilitySystemComponent.h"
Access: public
Description
Returns a reference to the multicast delegate that fires when the client replicates a targeting cancellation for the given ability/prediction-key pair. Bind to this on the server to react when the player cancels a targeting phase.
Caveats & Gotchas
- • The returned delegate reference is keyed to the specific ability/prediction-key pair; binding to it with a stale prediction key will never fire.
- • Delegates in AbilityTargetDataMap are not automatically cleaned up — call ConsumeAllReplicatedData after processing to avoid memory growth across many ability activations.
Signature
UE_API FSimpleMulticastDelegate& AbilityTargetDataCancelledDelegate(FGameplayAbilitySpecHandle AbilityHandle, FPredictionKey AbilityOriginalPredictionKey) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| AbilityHandle | FGameplayAbilitySpecHandle | Handle identifying the ability. | — |
| AbilityOriginalPredictionKey | FPredictionKey | Prediction key from when the ability was activated. | — |
Return Type
FSimpleMulticastDelegate& Example
Bind to the cancel delegate on the server C++
ASC->AbilityTargetDataCancelledDelegate(AbilityHandle, OriginalPredKey)
.AddUObject(this, &UMyTargetTask::OnTargetCancelled); See Also
Version History
Introduced in: 4.15
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?