Numbered Players

Options
I cannot figure out how to keep an array of player numbers. Each player has a PhotonNetwork.player.ID, but I cannot force it to only be from 1 to 4.
For instance if I have a max players of 4, and I check: if player is number 4 then turn the player red.
This works, but as soon as 4 disconnects all hell breaks loose. I cannot reassign the player numbers.

I guess my question is, How do I keep a list of players that can be indexed, and ensure It will never exceed the max player count?

Thanks for the help.

Answers

  • hello

    please try to store list of player in common script which manager your game play use rpc method. so you can use it and reassign it after disconnects All.