I am new to Unity and trying to figure out how networking works. I have this multiplayer game, where a player can host a game and other players can join a created game. Also, I have a “Player” prefab that I use to represent a player (a spaceship).
When someone create a game, I call Network.InitializeServer(), and then Network.Instantiate(player). When a client connects to a created game, I call Network.Conect() and then Network.Instantiate(player). What happens is that the host can see both players, but the client only see his own spaceship. Is Network.Instantiate(player) supposed to instantiate the prefab on clients that connects after this call? If not, how can I work around it?
What happens is that Network.Instantiate() is a buffered RPC, that means that it instantiates the prefab for every client, even if the client joined the network after the call was made. So there was my server, with the GameScene loaded and it’s prefab, then a client connects and immediatelly receive the RPC to instantiate the server prefab. But unfortunatelly, the client load his own GameScene, and then it loses the server prefab. It was a silly mistake, but maybe someone else have the same issue. Here is the link for the solution: http://unity3d.com/support/documentation/Components/net-NetworkLevelLoad.html