public void AddPlayerCharacter(NetworkConnection conn, short playerControllerID) { int playerID = PlayerManager.Inst.GetID(conn); if (playerID == -1) { Debug.LogError(string.Format("Player ID doesn't exist for con {0}", conn.ToString())); return; } PlayerSetting setting = PlayerManager.Inst.GetSetting(playerID); if (setting == null) { Debug.LogError(string.Format("Player Setting doesn't exist for ID {0}", playerID)); return; } ServerPlayer newPlayer = (ServerPlayer)Instantiate(playerPrefab, spawnPosition, Quaternion.identity); PlayerManager.Inst.Set(setting.playerID, newPlayer); newPlayer.Init(setting); NetworkServer.AddPlayerForConnection(conn, newPlayer.gameObject, playerControllerID); }