RealDocs

UAbilitySystemComponent::ServerSetReplicatedEvent

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

Description

Reliable server RPC that tells the server a generic replicated event occurred on the client (e.g. input confirm/cancel). The server stores the event and fires any registered delegates.

Caveats & Gotchas

  • Do not call this directly — the ability system calls it internally. Calling it manually without proper prediction keys will desync ability state.
  • This is a reliable RPC, so excessive calls (e.g. binding it to high-frequency input) can saturate the reliable RPC buffer and cause disconnects.

Signature

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

Parameters

Name Type Description Default
EventType EAbilityGenericReplicatedEvent::Type The type of generic replicated event (e.g. InputConfirm, InputCancel).
AbilityHandle FGameplayAbilitySpecHandle Handle to the ability spec this event belongs to.
AbilityOriginalPredictionKey FPredictionKey The prediction key that was active when the ability was activated.
CurrentPredictionKey FPredictionKey The prediction key active at the time this event is sent.

Return Type

void

Example

How the engine routes a confirm input to the server C++
// Called automatically by the input confirmation path inside UGameplayAbility:
// ASC->ServerSetReplicatedEvent(
//     EAbilityGenericReplicatedEvent::InputConfirm,
//     Handle, OriginalPredictionKey, CurrentPredictionKey);
// You would not write this call yourself in normal gameplay code.

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.