How can I avoid multiple players being spawned at a Player Start at the same time, side by side?

Hi, I’ve noticed when changed from 4.0.2 to 4.1 that before no extra player could be created in a PlayerStart if there was already one there, but now what happens is that multiple players can be created and put side by side in one PlayerStart. How to prevent this from happening, preferably within the editor or in the game mode subclass cpp? I’ve checked out PlayerStart.cpp but what I’m looking for isn’t there, possibly needs to be done in the game mode, but how?

The creation of players is done with the CreatePlayer function in my game mode, called multiple times. The mentioned problem happens independently of the amount of PlayerStarts in the level.

You could override ChoosePlayerStart in GameMode.cpp, enumerate through all player objects and player starts and simply block the spawn if there is already player too close to the player start.

I’m not sure what kind of effect you’re looking for, but you could always use blueprint to teleport them to a specific spawn based on their controller id or whether they collide with another player within x seconds of their spawning etc.

In 4.1 a bug was fixed that prevented finding a safe teleport spot if the specific player start was taken. This, I would think, would generally be considered a better outcome than a failure to spawn at all.

For 4.2 I’ve improved the default player start picking behavior such that if there are multiple player starts we will try to pick one that is not occupied before falling back to finding a safe spot at an already occupied spot.

Hi, Marc, thanks for you answer, and thanks to Ardivaba and PolytizeMeCapN too for the suggestions.

What you say as aimed for 4.2 is music to my ears, I really think that the player creation process needs complete blueprint and editor based solutions.

As I haven’t succeed solving this in code by now, I think I’ll try the teleport at start option PolytizeMeCapN suggested (I will update to say if it worked as expected), and give a try to what the 4.2 update offers once it’s out, for more professional results.

OK, so I’ve resolved it through teleporting characters to PlayerStarts at BeginPlay; when 4.2 comes out I’ll try out the new system explained by Marc Audy.