I need to sync a variable so all the players have the same value. I have tried with something like this
[PunRPC]
void Setting ()
{
I = somevalue;
//I Is my int
}
And I call it the following way:
PhotonView PV = GetComponent();
PV.RPC("Setting", RPCTargets.All);
But the int value is null. What am I doing wrong?
[PunRPC]
void Setting ()
{
I = somevalue;
//I Is my int
}
And I call it the following way:
PhotonView PV = GetComponent();
PV.RPC("Setting", RPCTargets.All);
But the int value is null. What am I doing wrong?