RealDocs

UActorComponent::OnRep_IsActive

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

Description

RepNotify called on clients when the replicated bIsActive property changes. The default implementation handles enabling or disabling the component's tick accordingly.

Caveats & Gotchas

  • Always call Super::OnRep_IsActive() when overriding — the base implementation re-enables or disables ticking based on the new active state, which is essential for correct tick behaviour on clients.
  • This function is called on clients only; the authoritative server changes bIsActive directly via Activate/Deactivate and never triggers the RepNotify on itself.

Signature

ENGINE_API virtual void OnRep_IsActive()

Return Type

void

Example

Override to react to active state change on clients C++
void UMyComponent::OnRep_IsActive()
{
	Super::OnRep_IsActive();
	// Additional client-side reaction to activation state change:
	if (IsActive())
	{
		StartClientEffect();
	}
	else
	{
		StopClientEffect();
	}
}

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.