AGameModeBase::K2_PostLogin
#include "GameFramework/GameModeBase.h"
Access: public
Specifiers: UFUNCTIONBlueprintImplementableEvent
Description
Blueprint-implementable event fired at the end of `PostLogin`. Implement this in a Blueprint GameMode subclass to react to a new player joining without overriding C++.
Caveats & Gotchas
- • In Blueprint this event appears as **OnPostLogin** (the `DisplayName` meta). If you search for `K2_PostLogin` in Blueprint, you will not find it — look for `OnPostLogin`.
- • This fires after `Super::PostLogin` has completed and the pawn has been spawned, so `NewPlayer->GetPawn()` is safe to call here.
- • Do not call this directly from C++; it is a Blueprint event stub. To trigger equivalent C++ logic, override the virtual `PostLogin`.
Signature
ENGINE_API void K2_PostLogin(APlayerController* NewPlayer) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| NewPlayer | APlayerController* | The player controller that has just logged in. | — |
Return Type
void Example
Welcome the player in Blueprint (pseudocode) text
Event OnPostLogin (NewPlayer: PlayerController)
-> Cast NewPlayer to MyPlayerController
-> Call ShowWelcomeMessage on result
-> Print 'Player joined: ' + NewPlayer.PlayerState.GetPlayerName() Version History
Introduced in: 4.14
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?