Network.instantiate in different scene

Hi Im new in unity networking…
Im trying to make multiplayer game, Im follow this tutorial → How to create an online multiplayer game with Unity - Paladin Studios
everythings was alright and the tutorial works perfectly

but I want to make game in different scene.
so 1st scene is lobby, and 2nd scene is game play
but when Im making network instantiate in 2nd scene, the 1st player did not appeared in client, just the 2nd player. but in host its appeared perfectly…

and the client always show this error
View ID AllocatedID: 1 not found during lookup. Strange behaviour may occur
Received state update for view id’ AllocatedID: 1’ but the NetworkView doesn’t exist

anyone got same issue ??

  1. create script >>networkLoadLevel.js<< the code on below.(copy all code )
    http://docs.unity3d.com/Manual/net-NetworkLevelLoad.html
  2. open 1st scene.
    2.1.create empty object use name NetworkLevelLoad(you can use other name).
    2.2.drop script file networkLoadLevel.js on Inspector of gameObject name “NetworkLevelLoad”.

3.you will see (Size,Element 0,Disconnected Level) on Inspector.
3.1.Size is amount of Element ,you can use more number such as 2 ,you will have Element 0 and Element 1(new).
3.2.Element 0 is 2nd scene,on you instantiate in 1st scene,you will see button name “First Person”(“First Person” is name scene of 2nd scene) and when have client connect to network,when >>server<< click button name “First Person” all client in network will change to 2nd scene name “First Person”.
3.3.Disconnected Level is 1st scene(“empty menu” is name of 1st scene),if you have disconnect(client or server disconnect) you will returned to 1st scene name “empty menu”,not returned all client or server.

  • you can use spawn player script run in 2nd scene ,not run in 1st scene,1st scene it same wait room.

:wink:

Still not working :frowning:
1st player wont appear in client
when Im using networkloadlevel in sceneLobby it keep crashing my unity
so now Im using 3 scene

  1. networkmanager scene-> contains networkloadlevel.js
    1703630--107177--networkloadlevel.png
  2. sceneLobby scene → contains networkmanagerscript
    do I need special function to load level ?? im using application load level like this
void OnMasterServerEvent(MasterServerEvent mse)
    {
        if(mse == MasterServerEvent.RegistrationSucceeded)
        {
            print ("Registered Server");
            Application.LoadLevel("scene1");
        }
    }

    void OnConnectedToServer()
    {
        print ("connected to server");
        Application.LoadLevel("scene1");
    }
  1. scene1 scene → the game scene contains network.instantiate
    void OnEnable()
    {
        spawnObj.x = Network.connections.Length * 5;
        Network.Instantiate(playerPrefab, spawnObj, Quaternion.identity, 0);
    }