Event OnPostLogin being called when game launches

Hi,

I’m following one of Epic’s tutorials on YouTube showing how to set up a lobby and join multiplayer sessions.
YouTube Tutorial

In the video he uses Event OnPostLogin in the game mode to show the lobby menu (I.e. add the widget to viewport) which is working fine in his video. But for some reason when I launch my game Event OnPostLogin is running straight away so I see the lobby menu with my main menu sat on top of it (The function which displays the main menu is called in the level blueprint on Event BeginPlay). I can’t figure out why it’s happening to me but not in the video.

If you need any info or screenshots of anything please let me know, but I’m not sure what to post as Event OnPostLogin is triggered by the engine not my blueprints.

Any help would be appreciated.

hi,

the main menu presumably only gets displayed when a client starts the game and is not yet connected to the server. that means you need a main menu map where you have your main menu, from there you can connect to the server and it switches the map. when the client is connected the onPostLogin gets fired and you have your lobby menu. when you test your game in PIE it auto connects to the server

Thank you for your reply. I tried turning off ‘Auto Connect to Server’ in settings somewhere (can’t find it now) and was running it in standalone game, but it still didn’t solve the problem. I got around it in the end by checking if the Lobby map is loaded before adding the lobby widget to viewport.