RealDocs

AActor::UpdateAllReplicatedComponents

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

Description

Rebuilds the actor's ReplicatedComponents cache from scratch so it exactly matches all currently-owned components whose IsReplicated() returns true.

Caveats & Gotchas

  • This performs a full scan of all owned components and should not be called every frame. It is intended for one-time synchronisation after bulk component changes.
  • Called automatically during PostInitializeComponents and when ResetOwnedComponents runs — you rarely need to invoke it manually.
  • Any component that was in the cache but is no longer found will silently be removed, which may cause replication gaps if called at the wrong time.

Signature

ENGINE_API void UpdateAllReplicatedComponents()

Return Type

void

Example

Force full re-sync after bulk component swap C++
// After replacing many components in one operation:
for (UActorComponent* OldComp : OldComponents)
{
    OldComp->DestroyComponent();
}
for (UActorComponent* NewComp : NewComponents)
{
    NewComp->RegisterComponent();
}
UpdateAllReplicatedComponents(); // rebuild cache once

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.