Search Unity

How does Network Instantiate per group work?

Discussion in 'Multiplayer' started by April, May 18, 2010.

  1. April

    April

    Joined:
    Dec 14, 2009
    Posts:
    62
    Hi, I tried to assign the network View of my object when I load a new level. Then I tried to instantiate an object only to clients in the same level. In the server, all levels have been loaded additively upon startup.

    So, I wrote

    if (Application.loadedLevel == 1) {

    networkView.group = 1;

    Network.Instantiate(myGameObject, transform.position, transform.rotation, 1);

    } else if (Application.loadedLevel == 2) {

    networkView.group = 2;

    }

    However, myGameObject gets instantiated in all clients regardless of the level. And the newly instantiated game object's network view group was still 0. I wondered what the use of the network view group parameter in Network.Instantiate was.

    Help, please.

    Thanks.
     
  2. April

    April

    Joined:
    Dec 14, 2009
    Posts:
    62
    I also tried passing RPC messages. But messages from group 0 were still received by group 1.

    It was like I just used RPCMode.AllBuffered.
     
  3. nbalexis1

    nbalexis1

    Joined:
    Jul 21, 2011
    Posts:
    89
    I get the same problem. I use Network.Instantiate, set group as 1 or 2 or something else, but in OnNetworkInstantiate, it's always 0.