AActor::TearOff
#include "GameFramework/Actor.h"
Access: public
Specifiers: UFUNCTIONBlueprintCallablevirtual
Description
Server-side call that stops replication for this actor and promotes all existing client copies to local authority (`ROLE_Authority`). Useful for ragdolls or destruction effects that no longer need server synchronisation.
Caveats & Gotchas
- • Must only be called on the server (authority). Calling it on a client has no effect and may trigger warnings.
- • Tearing off is irreversible — you cannot re-enable replication after calling TearOff(). If you need temporary replication suspension, consider using NetDormancy instead.
- • Clients that receive the torn-off notification will fire `OnTearOff()` (the rep-notify). The actor is then simulated locally and diverges from other clients, so physics / game state will no longer be synchronised.
Signature
UFUNCTION(BlueprintCallable, Category=Networking)
ENGINE_API virtual void TearOff(); Return Type
void Example
Tear off a character on death to let it ragdoll locally C++
void AMyCharacter::Die()
{
if (HasAuthority())
{
TearOff();
GetMesh()->SetSimulatePhysics(true);
}
} See Also
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?