Search Unity

Received state update for view ID AllocatedID: but no init

Discussion in 'Multiplayer' started by friuns3, Dec 8, 2009.

  1. friuns3

    friuns3

    Joined:
    Oct 30, 2009
    Posts:
    307
    i have non allocated boxes in scene
    Code (csharp):
    1.  
    2.         GameObject[] cts = GameObject.FindGameObjectsWithTag("Box");
    3.         for (int i = 0; i < cts.Length; i++)
    4.         {
    5.             GameObject a = cts[i];
    6.             a.AddComponent<NetworkView>();
    7.             a.networkView.observed = a.rigidbody;
    8.             a.networkView.stateSynchronization = NetworkStateSynchronization.ReliableDeltaCompressed;
    9.             a.name += i;                        
    10.         }
    11.  
    when player take box function called:
    AssignID(i, Network.AllocateViewID()); // i: box index


    Code (csharp):
    1.  
    2.     [RPC]
    3.     public void AssignID(int i, NetworkViewID id)
    4.     {
    5.         CallBuffered(Group.Rig, "AssignID", i, id);
    6.         GameObject g = GameObject.FindGameObjectsWithTag("Box")[i];        
    7.         g.networkView.viewID = id;
    8.         g.networkView.observed = g.rigidbody;
    9.        
    10.         Trace.Log(IsMine + "Assinged network id" + g.networkView.viewID);
    11.     }
    12.  
    13. public void CallBuffered(Group group, string fc, params object[] prs)
    14.     {
    15.         if (networkView.isMine)
    16.         {
    17.             networkView.group = (int)group;
    18.             networkView.RPC(fc, RPCMode.OthersBuffered, prs);
    19.         }
    20.     }
    21.  
    22.  
    on both sides allocated ids are correct and owners too

    on server side works fine , but on clients side i get error "Received state update for view ID AllocatedID: * but no initial state has ever been sent. Ignoring message."

    what wrong i do? what this error means?