How do I make each spawn in a multiplayer game spawn at it's own spawnpoint?

I have a map with 10 Player Starts in it. My game mode spawns the Default Pawn Class when the game starts. When I set the Number of Players to a number above 1, all players spawn at the 10th Player Start and pile up on top of each other.

How do I make it so the first player spawns at the first player start, the second player at the second player start, third player at the third player start, etc?

I’d say make some sections where they can spawn, and then have them randomly spawn around those areas. You can also make it so before they spawn in that location, that it will check if there are other players really close. If there are, then it will recalculate their spawn point.

You can do that by overriding the ChoosePlayerStart GameMode function, which is called every time a new Player is spawned to determine its spawn location.


The default behavior looks for a random unoccupied spot, but here’s a simple implementation that has it iterating through the available spawn points sequentially instead:

Note that NextPlayerIndex is a normal variable (not local), and initialized to -1 so that it’s incremented to 0 on the first call.

Please mark this as resolved if any of the given answers has helped resolve your issue. Thanks