APawn::TurnOff
#include "GameFramework/Pawn.h"
Access: public
Specifiers: virtual
Description
Freezes the pawn by stopping sounds, animations, physics simulation, and weapon firing. Intended for level streaming or cutscene scenarios where a pawn must become inert without being destroyed.
Caveats & Gotchas
- • TurnOff() does not unpossess the controller — input is still routed to the pawn unless you also call DisableInput(). For a complete freeze, call both TurnOff() and DisableInput().
- • ACharacter overrides this to also set movement mode to None and disable the character's capsule physics, but the base APawn implementation is minimal. If you have custom physics or audio components, you may need to override this to handle them.
Signature
virtual void TurnOff() Return Type
void Example
Freeze all pawns at game end C++
for (TActorIterator<APawn> It(GetWorld()); It; ++It)
{
It->TurnOff();
It->DisableInput(nullptr);
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?