Hi everyone! I’m quite new to unity.
I’ve got a little task and doesn’t know how to solve it. I’ve got client and server in unity - they are connected and work fine. And I need to make a ping-pong between them - I mean - client send “1” to server, server increment it by 1 and as result send to client “2”, and so on.
How to do this? ( 2 days trying to do it.
You need to use a RPC function.
http://unity3d.com/support/documentation/Components/net-RPCDetails.html
@RPC
function Pong (number : int)
{
number++
networkView.RPC ("Pong", RPCMode.Others, number);
}