[PUN] Looking for Rpc clarification for lobby - doing something wrong

So the UI has a list of players. Let’s say it defaults to say “0” for the # of players.

Whenever a player joins the lobby, I want EVERYONE’s UI to also read numOfPlayers++.

So the master client (M) joins, total players 1.
Another client (C) joins, total players 2.

Right now, I’m trying this (and it doesn’t seem to work):

public override void OnJoinedRoom()
{
    base.OnJoinedRoom();
    RpcUpdatePlayerUI();
}
[PunRPC]
void RpcUpdatePlayerUI()
{
    int playerCount = PhotonNetwork.room.PlayerCount;
    playerCountTxt.text = playerCount.ToString();
}

Results:
M = 1
C = 2

My guess is that C wasn’t a master client, so it didn’t have permission to Rpc to the others, so it only assigned itself.

So with UNET, I could just [Command] to talk to the host to Rpc to others. How would I do the equiv. in Photon?

Resolved: The Photon Forum is Closed Permanently. | Photon Engine

1 Like