UAbilitySystemComponent::GetReplicatedDataOfGenericReplicatedEvent
#include "AbilitySystemComponent.h"
Access: public
Description
Returns the FAbilityReplicatedData stored for the given generic event, containing whether the event has been received and any vector payload sent with it.
Caveats & Gotchas
- • Returns a copy, not a reference — the returned struct reflects the state at the time of the call and will not update if the event is later consumed or modified.
- • Check FAbilityReplicatedData.bTriggered before using the payload; if the event has not been received yet, the struct will be default-constructed with bTriggered == false.
Signature
FAbilityReplicatedData GetReplicatedDataOfGenericReplicatedEvent(EAbilityGenericReplicatedEvent::Type EventType, FGameplayAbilitySpecHandle AbilityHandle, FPredictionKey AbilityOriginalPredictionKey) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| EventType | EAbilityGenericReplicatedEvent::Type | The event type to query. | — |
| AbilityHandle | FGameplayAbilitySpecHandle | Handle to the ability spec. | — |
| AbilityOriginalPredictionKey | FPredictionKey | The prediction key identifying the activation. | — |
Return Type
FAbilityReplicatedData Example
Reading a vector payload from a previously received event C++
FAbilityReplicatedData EventData = ASC->GetReplicatedDataOfGenericReplicatedEvent(
EAbilityGenericReplicatedEvent::InputConfirm,
AbilityHandle, OriginalPredictionKey);
if (EventData.bTriggered)
{
FVector AimDir = EventData.VectorPayload;
// Use aim direction...
} See Also
Tags
Version History
Introduced in: 4.16
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?