Creating Spawn Points in Unity
Every Multiplayer game requires spawn points for the players to be generated into the game environment. This is an incredibly easy process in Unity and is vitally important as you do not want several players spawning on each other when the game starts.
The key to this is in the Network Manager component and in the Registered Spawnable Prefabs section. It is inside this list here where we can add our starting points, In the hierarchy of the Unity project I added a Sphere object to act as my spawn point. I renamed this to SpawnPoint and turned off the collider which is generated with the 3D object. In order for the network to identify the spawn point, we need to add the Network Identity, this gives the point a unique ID. The other component needed is also the Network Start Position, this identifies the object as a Spawn Point for our networked game.
I then created a Prefab of this Spawn Point and added another instance of the Spawn Points so that we have two points for our game.
The next thing to do is to register the Spawn Points in the Registered Spawnable Prefabs. Click the plus button on the list to add a Spawn Point and drag an instance of the Sphere from your assets folder. This registers the object as a Spawn Point in our environment.
When you start your Network instance and the client version of the game, the players will spawn in their respective locations