Random Multiplayer Spawning

Godot Version

v4.2.stable.mono.official [46dc27791]

Question

I am having an issue on picking a random spawn location for multiplayer. I was trying to have an area3D try and detect a player in a spawn area and then prevent that spot from being chosen. It is not working and it seems that when a player is spawned the area is detecting the entering and exiting simultaneously. So even though that player that spawned there is still in the spawn area it is not detecting them. Is there a standard way to pick a random spawn location from a list of locations?

Thanks,
Matt

hi matt,
it looks like the player should just take the coordinates of the spawn. right when a player is being spawned, the location for that will either add to an array or remove from an array, depending on how you designed it. so next player will just need to get the location from the same array and always added to the array / remove it from array so wont be the same location.

then i think just need to remove the location once a player has spawned there, so next one wont take the same location

1 Like