RealDocs

AActor::GetReplicatedCustomConditionState

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

Description

Called once when this actor begins replicating to initialize the active state of properties registered with `COND_Custom`. Override to set initial per-property condition flags.

Caveats & Gotchas

  • This is called only at replication start, not continuously. To change a property's condition at runtime, call `SetReplicatedPropertyCondition` on the actor rather than modifying state here.
  • Always call `Super::GetReplicatedCustomConditionState(OutActiveState)` to avoid dropping parent class conditions.
  • Only relevant for properties declared with `DOREPLIFETIME_CONDITION(MyClass, MyProp, COND_Custom)`. Properties with other conditions ignore this call entirely.

Signature

ENGINE_API virtual void GetReplicatedCustomConditionState(FCustomPropertyConditionState& OutActiveState) const override;

Parameters

Name Type Description Default
OutActiveState FCustomPropertyConditionState& State object to populate with initial active/inactive flags for each custom-condition property.

Return Type

void

Example

Initialize a custom condition to disabled C++
void AMyActor::GetReplicatedCustomConditionState(FCustomPropertyConditionState& OutActiveState) const
{
	Super::GetReplicatedCustomConditionState(OutActiveState);
	// SecretData starts inactive — only enabled for spectators later
	OUTACTIVE_STATE_NAMED_FUNC(AMyActor, SecretData, false);
}

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.