UAbilitySystemComponent::InvokeReplicatedEventWithPayload
#include "AbilitySystemComponent.h"
Access: public
Description
Fires registered delegates for the given generic replicated event and delivers the accompanying vector payload. Used when the event carries positional or directional data.
Caveats & Gotchas
- • The payload vector is only accessible to delegates that read it via the FAbilityReplicatedData struct — plain FSimpleMulticastDelegate callbacks will not receive the vector.
- • Like InvokeReplicatedEvent, returns false when no delegate is registered yet; the event and payload are cached until a matching delegate registers.
Signature
bool InvokeReplicatedEventWithPayload(EAbilityGenericReplicatedEvent::Type EventType, FGameplayAbilitySpecHandle AbilityHandle, FPredictionKey AbilityOriginalPredictionKey, FPredictionKey CurrentPredictionKey, FVector_NetQuantize100 VectorPayload) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| EventType | EAbilityGenericReplicatedEvent::Type | The type of event to invoke. | — |
| AbilityHandle | FGameplayAbilitySpecHandle | Handle to the ability spec. | — |
| AbilityOriginalPredictionKey | FPredictionKey | The prediction key active when the ability was activated. | — |
| CurrentPredictionKey | FPredictionKey | The current prediction key. | — |
| VectorPayload | FVector_NetQuantize100 | The vector payload received alongside the event. | — |
Return Type
bool Example
Receiving aim direction inside a waiting ability task C++
// Inside a custom ability task that waits for a confirm event with payload:
bool bFired = ASC->InvokeReplicatedEventWithPayload(
EAbilityGenericReplicatedEvent::InputConfirm,
Handle, OriginalKey, CurrentKey, AimDirection);
// The registered delegate receives AimDirection via FAbilityReplicatedData.VectorPayload See Also
Tags
Version History
Introduced in: 4.16
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?