Search Unity

Third Party Photon Pun 2 PlayerList sorted by what?

Discussion in 'Multiplayer' started by marcospgp, Feb 13, 2021.

  1. marcospgp

    marcospgp

    Joined:
    Jun 11, 2018
    Posts:
    194
    I'm trying to point to a specific player in a room through an RPC. It seems the easiest property to send through is the actor ID.

    The documentation for
    PhotonNetwork.PlayerList
    says:

    upload_2021-2-13_22-53-56.png

    But it does not say what key the list is sorted by. Is it the actor number? And is this number shared across the room or does every client have its own actor number for each player?

    Thank you!
     
  2. Munchy2007

    Munchy2007

    Joined:
    Jun 16, 2013
    Posts:
    1,735
    As I recall it's sorted by actor number ascending, but you can easily confirm this yourself, with a quick debug.log of the contents.

    The list is the same for all clients, so an actor number on any client refers to the same player.
     
    marcospgp likes this.