Lets say I have 20 variables, labelled position1 to position20, and I want to be able to access them in a for loop by referencing them by their number.
I would wish I could use something along the line of:
for (int i = 1; i < list.count; i++){
new Vector3 positionToAnalyse = “position” + “i” //So that the first iteration gives position1 and the next position2
}
I know this a very stupid way of doing it but I have set up the rest of the code around it so changing it would probably take longer and be more annoying.
Any help is highly appreciated