Spent the last 1-2 hours looking for the answer and haven't quite got it, I'm hoping it's something simple.
I have created an array of a custom class with just a small number of values like so (where Person is a Class):
Person person[] = new Person[2];
(Note I'll be replacing the 2 with a variable like numberOfPeople)
I need to create a method that I can call when needed (on a button press for example) that will move from the current person to the next in the array (going back to the start when it reaches the end).
In other words: On button press - move from player0 to player1.
I've been looking at how to use For, ForEach, If etc to do this but can't work it out.
SOLVED VIA Vincent Ugenti's ANSWER. In case other noobs come across this to solve their problem, had a few subsequent noob issues where I was trying to define the number of values in the array with a variable which wasn't given a value until after the array was made (causing instant crashing) and then I forgot doing nothing more with the code than this won't run each objects Constructor which needs to be done separately.