Identify Master player in Room

Options
hello,
if i assign some tag to Master of room. than In another instance of Game can find the tag with Master object or Not??
currently if i use simple method to assign master tag to player who connects first. but in another instance i cant find the player with master tag in remotely Gameplay. and if i use RPC to assign tag than the newly generated player got also execute this code and get the master Tag in Both game play.
Please help me ..

if any other idea to identify player from which is master or i want to find out view id of master player.

Suggest me please....

Comments

  • You could use the RPC to assign then when you're going to execute the code, do a check to see if photonView.isMine (or isn't, depends on who is supposed to run the code).
  • @crodriguez08
    Hello thanks for reply.
    i have also try with RPC method. but in another gameplay their local player will get master than there are two master tag object in game.
    Simply i want the master player photon view id from any instance. if it is local in room or remotely generated player at another instance.
  • vadim
    Options
    Hi,

    PhotonNetwork.isMasterClient returns true if client is master of currently joined room (in PUN terms).
    If you need 'tag' other clients, use custom player properties.
  • @vadim
    Thanks for reply.
    If i join anyones created room than how can i will be master????. But same issue happen with me.

    in My code lets see just check my code what i have done.

    foreach(PhotonPlayer player1 in PhotonNetwork.playerList)
    {
    if(player1.isMasterClient)
    {
    player.transform.tag = "master";
    }
    }

    In this code player is instantiated gameobject . here in this code i use foreach for all player of room and i check which player satisfied ismaterclient condition this player got master tag.so only one player from room should satisfied this condition.

    But this script in all instance than all generated local player get this master tag. i don't know why this happen.
    As i know there will be only one master player in room. so why such problem arise.
    please help me....