RealDocs

UActorComponent::TearOffReplicatedSubObjectOnRemotePeers

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

Description

Stops replicating a subobject and releases ownership of its client-side replica, leaving the client copy alive but no longer driven by the server. Use when clients should keep a local copy after the server stops managing it.

Caveats & Gotchas

  • Unlike DestroyReplicatedSubObjectOnRemotePeers, the client replica is NOT destroyed — it becomes an independent, authority-free object on the client. This is analogous to AActor::TearOff but for subobjects.
  • Once torn off, properties on the client-side replica will no longer receive updates. Any further mutations on the server are invisible to clients.

Signature

ENGINE_API void TearOffReplicatedSubObjectOnRemotePeers(UObject* SubObject)

Parameters

Name Type Description Default
SubObject UObject* The subobject to tear off on all connected remote peers.

Return Type

void

Example

Tear off a subobject to let clients keep a local copy C++
void UMyComponent::DetachSubData()
{
	if (MySubData)
	{
		TearOffReplicatedSubObjectOnRemotePeers(MySubData);
		// Server no longer manages MySubData replication;
		// each client keeps its last-known copy independently
		MySubData = nullptr;
	}
}

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.