- Home /
Question by
Zahiro · Oct 27, 2016 at 03:21 PM ·
cameranetworkingbeginnerspawning
How to spawn players ?
I have a custom Network Manager :
[SyncVar]
public int playersConnected;
void Update () {
if (playersConnected > 1) {
CharacterSelect ();
SceneManager.LoadScene ("stage1", LoadSceneMode.Single);
SpawnPlayers ();
}
}
The manager waits for 2 or more players to connect and then it heads all the players to the online scene and it works great with the "Auto create Player" option on the inspector but it spawns a player when connected so it's a problem with my matchmaking script because it gives the ability to the clients to play before 2 players are connected .
What i want to establish : spawn the players in round robin when SpawnPlayers() is called .
Actual question : what should the code for SpawnPlayers() be ?
I wish we could actually see what unity components code so i know what i should call to just spawn the players just at the desired moment
Comment