Hello
I have an object that has a script. The script calls a remote procedure call on itself, but only on object where the name hasn’t been modified. How can I fix this?
Thanks in advance.
All of the examples below are in the same script.
void Update()
{
//Let's send RPC calls to all the other players.
networkView.RPC("DoSomething", RPCMode.Others);
}
//This is supposed to be called on all objects with this script.
[RPC]
void DoSomething()
{
//This only gets called on objects with the default name, and not on objects with modified names.
Debug.Log("Prefab is doing something!");
}
NOTE: All of this is in one script, but it doesn’t get called on objects that don’t have the default name.