RealDocs

AActor::SetCallPreReplication

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

Description

Controls whether `PreReplication()` is invoked on this actor before each replication attempt. Disable it on actors whose replicated state never changes after spawning to reduce per-frame overhead.

Caveats & Gotchas

  • Disabling PreReplication skips the opportunity to conditionally dirty replicated properties. If you rely on `PreReplication` to call `DOREPLIFETIME_ACTIVE_OVERRIDE`, disabling this will break that logic.
  • The flag defaults to true only when the actor actually has a `PreReplication` override. Manually calling `SetCallPreReplication(true)` on actors without an override adds unnecessary overhead.
  • This setting persists for the lifetime of the actor — there is no automatic reset.

Signature

ENGINE_API void SetCallPreReplication(bool bCall);

Parameters

Name Type Description Default
bCall bool Whether PreReplication should be called on this actor before each potential replication.

Return Type

void

Example

Disable PreReplication for a static prop C++
void AStaticPropActor::BeginPlay()
{
	Super::BeginPlay();
	// This actor's replicated state is set once at spawn and never changes
	SetCallPreReplication(false);
}

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.