RealDocs

UActorComponent::RemoveReplicatedSubObject

function Engine Since 5.1
#include "Components/ActorComponent.h"
Access: public

Description

Unregisters a subobject so its properties are no longer replicated. Does not immediately destroy the replica on connected clients — the client copy persists until the owning actor replicates again with the pointer invalidated.

Caveats & Gotchas

  • This is a soft removal — existing client replicas are not immediately cleaned up. If you need the client replica destroyed right away, call DestroyReplicatedSubObjectOnRemotePeers instead.
  • Calling this with a nullptr or an object that was never registered is safe and silently ignored.

Signature

ENGINE_API void RemoveReplicatedSubObject(UObject* SubObject)

Parameters

Name Type Description Default
SubObject UObject* The subobject to unregister from replication.

Return Type

void

Example

Unregister a subobject when it is no longer needed C++
void UMyComponent::ClearSubData()
{
	if (MySubData)
	{
		RemoveReplicatedSubObject(MySubData);
		MySubData = nullptr; // Next actor replication will clean up client copies
	}
}

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.