Get an array of connected players?

Options
Hi Im making a hide and seek game and I need a mode where one player gets randomly choosen to be the seeker after x amount of time . I was wondering if the player ID is stored in some array and how to access.

Comments

  • PhotonNetwork.playerList should do the trick. That includes your player as well. If you need all the players except you, use PhotonNetwork.otherPlayers
  • antigode
    Options
    I can't find any alternative with realtime SDK. It doesn't exist ?
  • JohnTube
    JohnTube ✭✭✭✭✭
    edited June 2019
    Options
    Hi @antigode,

    All players joined to the room, including local:
    Dictionary, keys are actor numbers:
    LoadBalancingClient.CurrentRoom.Players
    Values:
    LoadBalancingClient.CurrentRoom.Players.Values
    Array of players:
    LoadBalancingClient.CurrentRoom.Players.Values.ToArray();
  • antigode
    Options
    Ok thank you i've really searched hours for this x_x
  • Malik109a
    Options
    Hi @Chickenspank
    Can you please guide me how you make player Seeker after some time? and how you tell other users in the game?