Defining player spawn points
Spawn points are represented as prefabs in any scene that a networked player can connect to. For our purposes, we want four different kinds of spawn point: one for the red team, one for the blue team, one for the yellow team, and one for the green team.
Create an empty game object in your Square_Day scene and name it RedSpawn
. Position it so that it's in the center of the bottom floor of the red building, facing in the general direction of the doors:
Save the RedSpawn object as a prefab by dragging it from the hierarchy into your Prefabs
folder. Repeat this process by creating GreenSpawn, YellowSpawn, and BlueSpawn prefabs for the other buildings. Also, add all of these spawns to the Square_Night scene.
Once your prefabs have been created, highlight each in the Inspector and add a NetworkStartPosition component to it:
In order for our NetworkManager component to use these, we need to change the spawn method. Back in our lobby scene, highlight the NetworkManager...