Comparing Masterclient Variable with other clients?

Options
I want players joining a room to be able to check a variable of the masterclients to compare it to their own. Not trying to sync, just compare variables. Whats the best way to do this?

Comments

  • Hi @overbytestudio,

    if this value doesn't change very often and you only want to compare it, I guess the best way is to store that variable in the CustomPlayerProperties. When being in the room the MasterClient can call PhotonNetwork.player.SetCustomProperties to set this value. If another client enters the room, he can use PhotonNetwork.masterClient.CustomProperties to read a certain variable from the MasterClient's properties and compares it to his value.

    If it is something game / room related, you can also use the Custom Room Properties in order to store this value there. To set the Custom Room Properties, the MasterClient can use PhotonNetwork.room.SetCustomProperties. To read data from the properties the client can use PhotonNetwork.room.CustomProperties.