Hi,
I m actually learning the unity networking part and after going through unity’s documentation about RPC’s right here, I ve got pretty interested when reading this :
unfortunately, when trying this feature over unity It didn t seem to function
Here is what I’ve done for testing :
I got an empty Game Object to wich I linked a network view component (state synchronization set to off and observed set to none) and 2 scripts :
the first one
#pragma strict
#pragma implicit
#pragma downcast
var connectToIP : String = "127.0.0.1";
var connectPort : int = 25001;
var txt : String ="T E S T" ;
var cmd : boolean = false;
function Update () {
if (cmd)
networkView.RPC ("PrintText", RPCMode.All, txt);
}
function Awake () {
Network.InitializeServer(32, connectPort);
}
@RPC
function PrintText (text : String)
{
Debug.Log(text);
}
and here is the second
#pragma strict
#pragma implicit
#pragma downcast
function Update () {
}
@RPC
function PrintText (text : String)
{
Debug.Log(text+" Exemple2 !!!!!!");
}
according to the documentation about RPCs, the RPC call of PrintText of the second script should be fired, but actually its not happening only the first RPC of the first script is working (when I set cmd to true).
So did I misunderstood the documentation or do I have any problems on my scripts ??