Really quick/easy question about RPCs

quick question

All the client and the server have the same script attached.

var vartosend = int;
var vartorecieve = int;
function sendvar () {

          vartosend = vartorecieve;


i have a question about RPCMode.Server.

networkView.RPC("sendvar", RPCMode.Server);

Does this make :

the servers vartosend = the clients vartorecieve

the clients vartosend = the servers vartorecieve

the servers vartosend = the servers vartorecieve

Which one of these does the code do? Thank your for your time.

Have a Quishtay™ Day.

The last one.

The only data being sent between computers is the stuff inside the RPC call. So your RPC is sending no data; just “hey, run your sendVar function.” To send something, write sendvar to have an input (see the docs.)

Background: to get an int on my computer, over to your computer, it takes a few steps. It has to be packed into bytes, marked as low or high digit first (“endian”,) marked as an int added to a network packet, addressed and mailed. The RPC command does that with everything inside the ()'s, except the RPCMode – that just tells it how who to mail it to. When the server (or anyone) gets it, it unpacks it all. That’s the only way it gets data. Maybe it sees “sendvar”, 34. It turns that into sendVar(34) and runs it.