Search Unity

RPC calls

Discussion in 'Multiplayer' started by llavigne, Mar 12, 2008.

  1. llavigne

    llavigne

    Joined:
    Dec 27, 2007
    Posts:
    977
    if an RPC call is done from one script to another script, do I need a networkviewer on both end ?
     
  2. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    You need the network view in the script where the RPC is implemented. And you need to call the RPC on that network view, e.g.

    Code (csharp):
    1.  
    2.   myOtherCoolScript.networkView.RPC(...)
    3.  
    Sunny regards,
    Jashan
     
  3. llavigne

    llavigne

    Joined:
    Dec 27, 2007
    Posts:
    977
    thanks
     
  4. llavigne

    llavigne

    Joined:
    Dec 27, 2007
    Posts:
    977
    I read in the doc that the networkview just need to be attached to the gameobject.
    so with 3 different scripts attached to a go, all with rpcs, all you need is one networkview and this works but doesn't seem to function with buffer which appear to be very broken... or applied in an order non specific - larus, what's the order of buffer call for a new connected player ? before or after the scripts start on the remote machine ?