Set opponent nickname

Options
I created a game with 2 players (online). I would like to add nicknames. I added the owner nickname it was simple but how to add the opponent nickname without using the array?

https://paste.myst.rs/1vlwtrsa

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @sic_architect,

    Thank you for choosing Photon!

    Player Nickname is a player property that is automatically synchronized between players joined to the same room so no need to synchronize it via RPC!
    Simply set the Nickname of the local player and all other players joined to the same room will get it updated.
  • sic_architect
    Options
    I set local player name, but How Can I separate both?
  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @sic_architect,

    Simply make use of player.IsLocal or photonView.IsMine etc. to know if a player is local or not.
    And when you set Nickname set it to the local player only: PhotonNetwork.LocalPlayer.Nickname.