Hey all i am creating my own NetworkManager. When it comes to spawning the player it works how ever 2 players seem to spawn.
void OnServerAddPlayer(NetworkMessage mess)
{
Debug.Log("Add player: " + mess.conn);
GameObject thePlayer = (GameObject)Instantiate(Player, GameObject.FindGameObjectWithTag("SpawnPoint").transform.position, Quaternion.identity);
foreach (Transform cam in thePlayer.transform)
{
if(cam.tag == "MainCamera")
{
cam.gameObject.SetActive(true);
}
}
NetworkServer.AddPlayerForConnection(mess.conn, thePlayer, 0);
DisableObjects();
}
Any ideas as to why 2 players spawn and how to fix this issue.