Open stilnat opened 4 months ago
I would actually make this map-based, not code-based. The way I would like to see it done is by creating spawnpoint objects. These objects can be placed in the map editor. They will not be visible or interactive with the players in the round. They would only be visible to admins who have the map editor active.
okay so small correction, create a prefab called SpawnPoint that acts as a tile object, with a script so they register to a spawn system (maybe use one of the systems we already have if it makes sense), and use the tile coordinates from those spawn point to define where to spawn.
Same as above, If no free location, spawn at (0,0) with an error message for now.
Assign me
Summary
Currently, clients are spawning at the exact same location, resulting in clipping. Before spawning a player, server should choose a free tile, without tile objects or players and spawn the new player there.
One simple solution would be to predefine a list of tile location spawn and spawn the player on any of those, if it's free. If no free location, spawn at (0,0) with an error message for now. We'll improve the algorithm later.