- Home /
Call an RPC to a specific client
hello everyone, i'd like to ask what parameters should put in the RPC to call to a specific client?
Im using the server to call an RPC on each client to send them their unique integer ID.
the code is somewhat like this, this is a server code:
for(i=0 ; i<Network.connections.length ; i++)
{
networkView.RPC("SetID", *specific client* , i );
}
client code:
[RPC]
SetID(int id)
{
myID = id;
}
Comment
Best Answer
Answer by Albert · Sep 06, 2010 at 04:41 PM
hehe i didn't notice the parameters on the scripting guide. sorry! :D
for(i=0 ; i<Network.connections.length ; i++)
{
networkView.RPC("SetID", Network.connections[i] , i );
}
Your answer
![](https://koobas.hobune.stream/wayback/20220613072802im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
RPC call failed 1 Answer
Problem with spawn player with RPC calls(c #) 1 Answer
RPC calls to a specific client? 1 Answer