Networking - Player selection before joining a session

Hello everyone,

So I have been working on a networked game, in this game the player chooses their characters and then finds a game. so far everything in the game is working great network wise except one issue. Whenever a client choices their character before the game they are stuck the default character. However the client hosting has no problems with the character selection. The way I originally went about this is I figured I could use the Game instance class to store what class the player choose, then on connection to the server I overwrote the get default pawn method in the Game mode. This method got the PlayerState from the passed in controller, and calls a “Run on client” event. This event just calls into my custom GameInstance and gets the stored character class and stores it into the PlayerState.

This is assuming that the client still have their own game instance, which I may be wrong about. Any one have any suggestions or ideas on what I can do about that?

Thanks for your time.

GameInstance persists from the moment the Player opens the Game to the moment the Player closes it.

Using the GameInstance is a good choice to setup any Client side settings you want to retain across Server instances for that Player.

I do it the other way round. So basically they join the session as they are joining play loading screen etc. Then load the map they are going to be spawning in cover the screen with the character select screen widget so that the map isnt visible. Then once they select there character spawn them in as normal and unhide the widget.

another workaround also is instead of spawning multiple bp versions of different characters you just spawn one blueprint and then use the set skeleton mesh and set anim bp nodes to swap out the meshes and give them the right animations. It all depends on youre set up really.