How to know which photonView is the masterclient
Hello,
I need to know which player is the master client, so my code looks like this
I need to know which player is the master client, so my code looks like this
GameObject[] players = GameObject.FindGameObjectsWithTag("Player"); foreach (GameObject p in players) { PhotonView pv = p.GetComponent (PhotonView)(); if (pv.isMasterClient) { pv.RPC("myfunction",......); } }but photonView doesnt have isMasterClient on there. How can i know if a particular photonview is the master client?
0
Comments
-
Each player knows if they are the MasterClient or not, use: PhotonNetwork.IsMasterClient
0 -
Hi @dreadlocks,
As @Breeman wanted to say, I think there are easier ways to know who's the master client than doing an expensiveFindGameObjectsWithTag()
call.
replacepv.isMasterClient
withpv.Owner.IsMasterClient
0