ACharacter::TurnOff
#include "GameFramework/Character.h"
Access: public
Specifiers: virtualoverride
Description
Disables the Character by stopping its movement, disabling tick, and turning off input. Called automatically at end-of-game (e.g., when a match ends) to freeze all pawns.
Caveats & Gotchas
- • TurnOff is distinct from UnPossessed — it does not remove the controller, it merely freezes the character in place. The pawn remains possessed after this call.
- • ACharacter's override also stops the CharacterMovementComponent's velocity; if you have custom movement components, override this to stop them as well, otherwise the character may continue drifting.
Signature
ENGINE_API virtual void TurnOff() override; Return Type
void Example
Freeze character at end of round C++
// In a GameMode that ends the round:
void AMyGameMode::EndRound()
{
for (APlayerState* PS : GameState->PlayerArray)
{
if (APawn* Pawn = PS->GetPawn())
{
Pawn->TurnOff();
}
}
} See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?