Hi, how can I display other player's name? I have 4 players in room. I have already displayed name of local player and 1 other player. I have no idea how to display other 2 player's name.
PhotonPlayer remote2 = PhotonNetwork.player.GetNext();
if(remote2 != null)
{
this.playerNames[2].text = remote2.NickName +" ";
}
But all other texts displayer only 1 other players name.
Thank you
private void UpdatePlayerTexts()
{
PhotonPlayer remote = PhotonNetwork.player.GetNext();
PhotonPlayer local = PhotonNetwork.player;
if (remote != null)
{
this.playerNames[1].text = remote.NickName + " ";
}
else
{
//TimerFillImage.anchorMax = new Vector2(0f,1f);
//this.TimeText.text = "";
//this.playerNames[1].text = "waiting for another player 00";
}
if (local != null)
{
// should be this format: "YOU 00"
//this.playerNames[0].text = "YOU " + local.GetScore().ToString("D2");
this.playerNames[0].text = "YOU";
}
}
I have tried to addPhotonPlayer remote2 = PhotonNetwork.player.GetNext();
if(remote2 != null)
{
this.playerNames[2].text = remote2.NickName +" ";
}
But all other texts displayer only 1 other players name.
Thank you