RealDocs

UActorComponent::GetIsReplicated

function Engine Since 4.0
#include "Components/ActorComponent.h"
Access: public Specifiers: inlineconst

Description

Returns true if replication is enabled on this component via SetIsReplicated. Does not indicate whether the component is currently actively replicating — only that replication has been requested.

Caveats & Gotchas

  • This reflects the value of the bReplicates flag set by SetIsReplicated; it does not account for whether the owning actor itself is replicating. A component can have bReplicates=true while its actor has bReplicates=false, and no replication will occur.
  • For the most accurate picture of net simulation state, use IsNetSimulating() which combines GetIsReplicated() and GetOwnerRole() into a single check.

Signature

inline bool GetIsReplicated() const

Return Type

bool

Example

Conditional logic based on replication state C++
void UMyComponent::BeginPlay()
{
	Super::BeginPlay();
	if (GetIsReplicated())
	{
		// Set up replication-dependent resources
		SetupNetworkResources();
	}
}

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.