AActor::GetTearOff
#include "GameFramework/Actor.h"
Access: public
Specifiers: const
Description
Returns whether this actor has been torn off — that is, no longer receiving replication updates from the server and now running as a local authority copy on the client.
Caveats & Gotchas
- • Once an actor is torn off (`bTearOff == true`), it cannot be un-torn-off. The state is permanent for the lifetime of that actor instance.
- • On the server, GetTearOff() returns true only after `TearOff()` has been called. On a client, it returns true once the torn-off state has been replicated and the actor has promoted to `ROLE_Authority` locally.
- • Checking GetTearOff() on the server is useful to prevent re-enabling replication on an actor that is mid-teardown.
Signature
bool GetTearOff() const
{
return bTearOff;
} Return Type
bool Example
Guard logic against torn-off state C++
void AMyActor::SomeServerLogic()
{
if (GetTearOff())
{
// Actor is no longer networked; skip replication-dependent logic
return;
}
// ... normal logic
} See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?