RealDocs

AActor::IsReplicatedSubObjectRegistered

function Engine Since 5.1
#include "GameFramework/Actor.h"
Access: public Specifiers: const

Description

Returns true if the given object is currently registered as a replicated sub-object directly on this actor (not via a component).

Caveats & Gotchas

  • Only checks the actor's direct sub-object list, not the per-component sub-object lists. Use IsActorComponentReplicatedSubObjectRegistered for component-owned sub-objects.
  • Returns false if the actor does not have bReplicateUsingRegisteredSubObjectList enabled, since the registry is not used in the legacy replication path.
  • A sub-object can be present on the server but not yet on the client — this only reflects the server-side registry state.

Signature

ENGINE_API bool IsReplicatedSubObjectRegistered(const UObject* SubObject) const

Parameters

Name Type Description Default
SubObject const UObject* The object to look up in the actor's direct sub-object replication registry.

Return Type

bool

Example

Guard against double-registration C++
void AMyActor::ActivateBuffEffect(UBuffData* Buff)
{
    if (!IsReplicatedSubObjectRegistered(Buff))
    {
        AddReplicatedSubObject(Buff);
    }
}

Version History

Introduced in: 5.1

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.