AGameModeBase::K2_OnLogout
#include "GameFramework/GameModeBase.h"
Access: public
Specifiers: UFUNCTIONBlueprintImplementableEvent
Description
Blueprint-implementable event fired near the end of `Logout`. Implement in a Blueprint GameMode to react to a player leaving without overriding C++.
Caveats & Gotchas
- • In Blueprint this event appears as **OnLogout** (the `DisplayName` meta) — searching for `K2_OnLogout` in Blueprint will not find it.
- • `ExitingController->PlayerState` is still valid when this fires (same as `Logout`), but destruction of the controller begins shortly after. Do not store raw pointers to the controller.
- • This fires after `Super::Logout` and the global logout delegate, so all engine and plugin cleanup has already run by the time Blueprint handles this event.
Signature
ENGINE_API void K2_OnLogout(AController* ExitingController) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| ExitingController | AController* | The controller that is leaving the game. | — |
Return Type
void Example
Show a departure message in Blueprint (pseudocode) text
Event OnLogout (ExitingController: Controller)
-> Cast ExitingController to PlayerController
-> Get PlayerState from result
-> Print String: GetPlayerName() + ' has left the game.' Version History
Introduced in: 4.14
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?