Quantcast
Channel: Photon Unity Networking (PUN) — Photon Engine
Viewing all articles
Browse latest Browse all 8947

How to sync a variable through Photon

$
0
0
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?

Viewing all articles
Browse latest Browse all 8947

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>