AGameModeBase::K2_OnRestartPlayer
#include "GameFramework/GameModeBase.h"
Access: public
Specifiers: UFUNCTIONBlueprintImplementableEvent
Description
Blueprint event fired at the end of RestartPlayer and RestartPlayerAtPlayerStart after the pawn has been successfully spawned and possessed. Use this to trigger post-spawn game logic in Blueprint GameMode subclasses.
Caveats & Gotchas
- • Fires only after a successful spawn — if pawn spawning fails (e.g., blocked by geometry), K2_OnRestartPlayer is not called. Use FailedToRestartPlayer (C++ override) to handle that case.
- • The NewPlayer's pawn is already possessed by the time this fires, so GetPawn() on NewPlayer will return the newly spawned pawn.
- • This is a BlueprintImplementableEvent with no C++ base body. If you want equivalent functionality in C++ only, override FinishRestartPlayer instead.
Signature
ENGINE_API void K2_OnRestartPlayer(AController* NewPlayer); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| NewPlayer | AController* | The controller of the player who just restarted. | — |
Return Type
void Example
Award spawn bonus in Blueprint text
// In Blueprint GameMode subclass, implement the OnRestartPlayer event:
// Event OnRestartPlayer (NewPlayer)
// -> Cast to AMyPlayerController (NewPlayer)
// -> Call AwardRespawnShield on the player's pawn Tags
Version History
Introduced in: 4.14
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?