RealDocs

UActorComponent::GetComponentClassCanReplicate

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

Description

Returns true if this component class is allowed to replicate at all. Override and return false to permanently prevent a component type from ever being set as replicated, regardless of caller intent.

Caveats & Gotchas

  • This is a class-level capability check, not an instance-level state — returning false here means no instance of this component class can ever replicate, even if SetIsReplicated(true) is called on it.
  • The engine calls this in SetIsReplicated to silently discard replication requests; there is no warning or error when the request is rejected.

Signature

ENGINE_API virtual bool GetComponentClassCanReplicate() const

Return Type

bool

Example

Prevent a component type from replicating C++
// In a component that must never replicate (e.g. editor-only helper)
bool UMyEditorHelperComponent::GetComponentClassCanReplicate() const
{
	return false;
}

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.