How to get players from matchmaking server onto characters?

So let’s say a level only allows for two characters. From the dedicated server, only two players can connect to the level. There are two characters in the level. The map is two straight roads. One character is connected to the left road while the other character is connected to the right road. How do I assign a player to character1 and assign the other player to character 2?

Player controller —> Possess pawn

Check this out:

In short your AGameMode knows about all connected players and is responsible for managing connecting/connected players setting their initial state and starting the match when enough players are connected. It is ALWAYS created but ONLY on the server. It also has ChoosePlayerStar() in there.

You should also see AGameState which usually handles your most basic rules like how the players re-spawn holds their score and etc. It is ALWAYS created it is modified by the server (I think) and every player has an up-to-date copy of that class.