I’m attempting to create an online game which keeps the player character in the world after the player leaves.
Unfortunately I can’t seem to figure out how to do this, or even if this will work correctly while running in-editor, I know something needs overriding but I’m not entirely sure where.
For testing I use a .bat file to run the dedicated server and then run 2 clients from the editor itself, one to connect and disconnect.
At first, I thought it was handled by Logout in Gamemode but I took a closer look at it and it seems like its handled by HandleSeamlessTravelPlayer(). I suggest you look into this. Once I override this function, it does not destroy the pawn upon leaving the level.
More specifically, this function called Destroy on PlayerController. Inside that function, it handles what it should do with the pawn when leaving the game. Upon looking further into it. you could just override “PawnLeavingGame” function in player controller.