RealDocs

UAbilitySystemComponent::ReadyForReplication

function GameplayAbilities Since 4.20
#include "AbilitySystemComponent.h"
Access: public Specifiers: virtualoverride

Description

Called by the replication system when this component is ready to begin replication. Registers attribute sets and instanced abilities as replicated subobjects at the correct time in the component lifecycle.

Caveats & Gotchas

  • This must be called (via Super) if overridden; skipping it means attribute sets added after component registration will never be registered as network subobjects and will silently fail to replicate.
  • On clients this is not called — it is a server-side lifecycle hook; do not put client-side init logic here.

Signature

UE_API virtual void ReadyForReplication() override

Return Type

void

Example

Override to register a custom replicated object C++
void UMyAbilitySystemComponent::ReadyForReplication()
{
    Super::ReadyForReplication();
    if (IsUsingRegisteredSubObjectList())
    {
        for (UAttributeSet* Set : GetSpawnedAttributes())
        {
            AddReplicatedSubObject(Set);
        }
    }
}

Version History

Introduced in: 4.20

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.