How to make an array of GameObjects that stores their transforms?

How could I do this or when I call the function that needs this should I just use gameobjectArray.transform? What do you think?

Every GameObject has a transform so

 public GameObject[] myArray;

then you capture a GameObject with your click and increase the array index and add

myArray[index+1] = clickedGameObject;

you can then access it


don’t cut and paste that, just my thoughts, search Unity for many examples of actual code snippets.