Hi, I’m doing a multiplayer chess, and I don’t know how to do the conecction u_u.
I was searching for information about networking in the manual of unity, but a don’t found a example for helping to understand how to do it °_°.
It’ll wonderfull if any body can help me with this, I need only the code to send and receive a string to finish my proyect.
I’ll really appreciate it .
One solution is to use simple RPC calls. Something like…
var myString:String;
function sendString()
{
networkView.RPC("receiveString", RPCMode.OthersBuffered, myString);
}
@RPC
function receiveString(newString:String)
{
myString = newString;
}
You’ll notice that you’ll need a networkView attached for this to work. Also you’ll have to decide when and where to call the “sendString” function, and to which of the other clients the string should be sent (RPCMode.OthersBuffered is just an arbitrary example).
Of course, my snippet doesn’t explain any of these. As Benproductions already mentioned, all of this can be found in various tutorials. Just take my snippet as an inspiration.
I suggest to start here:
http://docs.unity3d.com/Documentation/Components/class-NetworkView.html
http://docs.unity3d.com/Documentation/Components/net-HighLevelOverview.html