How To Invoke RPC On Selected Multiple Clients

RCP allows you to send RPC message to selected clients in the room instead of all clients.

Each RPC call requires its associated RPC ID. The sender (Caller) client must specify the associated RPC ID when calling PRC calls.

// rpcID = 1 means that you will invoke RPC method associated with 1
int rpcID = 1;

// List of selected remote client IDs to execute RPC on
List<string> clientIDs = new List<string>();

clientIDs.Add(clientIDOne);
clientIDs.Add(clientIDTwo);

// For UDP client reliable = true means RUDP transmission
bool reliable = true;

bool called = rpc.RPCAll(rpcID, clientIDs, Encoding.UTF8.GetBytes("Hello World"), reliable);