Hi all,
First, sorry for my english so…i’ll try to explain my problem
I’ve got a game with 2 players, 1 player(host) it the host and can see himself and the client.
In the client screen cant see nothing, only the terrain, my code in my custom Network manager :
public class NetManager : NetworkManager {
public GameObject spawnZone;
/*public override void OnServerAddPlayer(NetworkConnection conn, short playerControllerId){
GameObject player = Instantiate (base.playerPrefab);
player.transform.SetParent (spawnZone.transform, false);
NetworkServer.AddPlayerForConnection(conn,player, playerControllerId);
//Debug.Log("Datos del jugador añadido: " + conn);
}*/
public override void OnServerReady (NetworkConnection conn){
base.OnServerConnect(conn);
NetworkServer.SetClientReady (conn);
GameObject player = Instantiate (base.playerPrefab);
player.transform.SetParent (spawnZone.transform, false);
}
public void StartGame(){
NetworkManager.singleton.StartHost ();
}
public void JoinGame(){
NetworkManager.singleton.StartClient ();
}
public override void OnClientConnect(NetworkConnection conn){
ClientScene.Ready (conn);
ClientScene.AddPlayer (0);
}
}
If i use OnServerAddPlayer the client throw a exception because this occurs before the scene load.
So i need to register in the server the host and the client and i need to see the both player in client.
Need help with this guys ![]()
Best Regards, Buscatrufas.