Skip to main content
2 of 3
added 250 characters in body
Zibelas
  • 4.6k
  • 2
  • 14
  • 22

If you want to keep track of the order when users joined the room (which should actually not matter much) you just need to keep track of them when they join the room. Photon is providing the player with OnPhotonPlayerConnected(PhotonPlayer newPlayer). You can set the time when they joined the room in the custom room property if needed with a time stamp. Let the masterclient handle it or let each client write it when they arrive. If you want to get a whole list of them at once, you can access them via PhotonNetwork.playerList.

PhotonNetwork persists between scenes and there are a few example tutorials provided directly by Photon. It's worth checking out both Pun and Pun2, since the examples they have are slightly different (Pun has for example a simple Rock-Paper-Scissor game which is missing in Pun2) but the code is almost the same.

And if you want to use something for displaying as scores, you should not use the userId but instead PhotonNetwork.player.NickName. The userId is unique, the Nickname is usually what the player is itself choosing and does not need to be unique.

Zibelas
  • 4.6k
  • 2
  • 14
  • 22