APawn::Restart
#include "GameFramework/Pawn.h"
Access: public
Specifiers: virtual
Description
Called when the pawn is restarted, typically immediately after possession. Use this to perform setup that should happen each time the pawn begins active play.
Caveats & Gotchas
- • Called on the server for all pawns and on the owning client for player pawns via `PawnClientRestart`. For AI pawns it is only server-side, so avoid client-specific logic here.
- • `Restart` is distinct from `BeginPlay` — it can be called multiple times during a pawn's lifetime (e.g., after each respawn), whereas `BeginPlay` runs only once.
Signature
virtual void Restart() Return Type
void Example
Enable movement on restart C++
void AMyPawn::Restart()
{
Super::Restart();
if (UPawnMovementComponent* MoveComp = GetMovementComponent())
{
MoveComp->SetActive(true);
}
} Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?