I intend to have 100+ buttons with the same script. The first of the 100 buttons I press needs to transform.parent to location1 and then move to the parent object’s location and then the next of those 100 buttons needs to transform.parent to location2 so on and so on. How can a script be made to have different outcomes based on how many buttons have been pressed?
Have a static int variable in your script that starts at 0. Increase that variable every time one of the buttons is pressed. Static variables maintain the same value across all instances of the script, so you can use a regular if statement to determine where the button should go.