RealDocs

AActor::UpdateReplicatedComponent

function Engine Since 4.15
#include "GameFramework/Actor.h"
Access: public

Description

Refreshes the actor's internal ReplicatedComponents cache for a single component after its replication state changes. Called automatically by the engine when SetIsReplicated is toggled on a component.

Caveats & Gotchas

  • This is an internal bookkeeping function. In almost all cases the engine calls it automatically — you should not need to call it manually.
  • Calling it on a component that was not registered with this actor produces undefined behavior.
  • After calling this, the component will appear in or be removed from the array returned by GetReplicatedComponents depending on its current IsReplicated() state.

Signature

ENGINE_API void UpdateReplicatedComponent(UActorComponent* Component)

Parameters

Name Type Description Default
Component UActorComponent* The component whose replication state has changed and whose presence in the cached array should be updated.

Return Type

void

Example

Manual cache refresh after programmatic component registration C++
// Only needed if you are manually managing component replication outside normal engine flow
MyDynamicComponent->SetIsReplicated(true);
UpdateReplicatedComponent(MyDynamicComponent);

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.