ACharacter::TornOff
#include "GameFramework/Character.h"
Access: public
Specifiers: virtualoverride
Description
Called when this Character's actor channel is torn off — it transitions from server-replicated to locally simulated on the client. ACharacter stops the CharacterMovementComponent's network updates and switches to physics-based simulation.
Caveats & Gotchas
- • After TornOff fires on a client, the Character no longer receives position corrections from the server; any remaining motion is driven by local physics. Ensure your death/ragdoll logic accounts for this.
- • TearOff (the AActor flag that triggers this) is one-way — you cannot un-tear an actor. If you need temporary authority transfer, consider RPCs instead.
Signature
ENGINE_API virtual void TornOff() override; Return Type
void Example
Enable ragdoll on tear-off (common death flow) C++
void AMyCharacter::TornOff()
{
Super::TornOff();
// The server has torn us off — switch mesh to physics (ragdoll)
GetMesh()->SetSimulatePhysics(true);
GetMesh()->SetCollisionEnabled(ECollisionEnabled::PhysicsOnly);
} See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?