I have edited this question to be more to the point and adding as many details as I can.
My game is on one machine, with 1-4 players. How do I make a system that goes to the next player at the end of each turn, and then after the last player goes back to the first? Please include some examples if you can. I’m sure this is a pretty easy thing but for some reason I just cannot wrap my head around it.
In Unity networking you can find the connected players by using
in generally, to find out the current turn, remaining turns and other stuffs, best way is handle them through MasterSever ( this may be differ depending on your game :))
Find more information about unity Networking
The simplest way I can think of is to create a class “Player” (for example) and stores the variable score and turnRemain inside it. Set the score and turnRemain to 0 and 9 respectively inside the class constructor.
Inside the main game class, you can create a List of Player. Each time a player joins the game, just add them to the list. For whose turn it is, just use a simple integer variable. You can also use this to work with the list, for example if you want to get the second player’s score;
with the “playerList” being the list name and “currentPlayerTurn” is the integer for keeping track whose turn it is.
Hope this will give you some ideas.