Having some issues receiving player names over photon network.
Not got a problem if i am the host i see both the hosts name and the opponents name, The problem comes when i join as the second player i see his name in both name slots not the hosts.
my code is below:
Player1 Code:
public UILabel playerName;
// Update is called once per frame
[PunRPC]
void Update () {
if (playerName != null) {
playerName.text = global.username;
}
}
}
Player2 Code:
public UILabel player2Name;
// Update is called once per frame
[PunRPC]
void Update () {
if (player2Name != null) {
player2Name.text = PlayerPrefs.GetString("SAVED_username", "");
}
}
}
Tried a few things but still the second player shows its name in both slots. Any solutions would be greatly appreciated thanks.