RealDocs

UAbilitySystemComponent::ConsumeGenericReplicatedEvent

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

Description

Clears the cached state of a single generic replicated event, allowing the same event type to be re-registered and fired again within the same ability activation.

Caveats & Gotchas

  • If the same event type can fire multiple times during one ability activation (e.g. confirm input triggering repeat casts), you must consume after each use — otherwise the next InvokeReplicatedEvent call finds the event already set and fires immediately without waiting.
  • This only unsets the event flag; registered delegates are not removed. Re-registering a delegate after consuming will correctly wait for the next incoming event.

Signature

void ConsumeGenericReplicatedEvent(EAbilityGenericReplicatedEvent::Type EventType, FGameplayAbilitySpecHandle AbilityHandle, FPredictionKey AbilityOriginalPredictionKey)

Parameters

Name Type Description Default
EventType EAbilityGenericReplicatedEvent::Type The event type to clear.
AbilityHandle FGameplayAbilitySpecHandle Handle to the ability spec.
AbilityOriginalPredictionKey FPredictionKey The prediction key identifying the activation.

Return Type

void

Example

Resetting an event for repeated use C++
// After processing InputConfirm in an ability task, reset it so it can fire again:
ASC->ConsumeGenericReplicatedEvent(
    EAbilityGenericReplicatedEvent::InputConfirm,
    AbilityHandle,
    OriginalPredictionKey);

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.