GetNext() return null

When I try to get who is other player in currentroom using Player.GetNext(), why the its return null? Even tough the sum of players in currentroom is 2. Could you help me why its return null? I need to access other player in that room. Thanks

Comments

  • It should only be null when you are not in a room or if there are not enough players in the same room.
    Are you calling this when you join or mid-game?
    It would help, if you could debug through GetNext() and see which case you get into that return null. We can't do that without a repro case.
  • in join. But after join, and when I debug log currentroom.players.count , the result is zero. What happened?
    And what should I do to make players join into room?
  • Within Join, maybe the player list is not yet filled and you ask for the next player "too early". Not sure.
    The players.count in a room should never be 0 unless you left a room.

    Maybe it's easier to help, knowing what you try to achieve.
Sign In or Register to comment.