Defining a number of gameobjects from another gameobject
I have three cubes: cube1, cube2, cube3. I also have a sphere which controls those cubes. On the sphere there's a script where the three cubes are defined as public gameobjects. I dragged and dropped my cubes into the slots in the inspector. Now what I need to do is for example change the color of those 3 cubes through my sphere controller script. How should I do that? I can use Array, but in this case I would have to tag my cubes, then use GameObject.FindWithTag... And I don't want to do that. Is there a way to define those 3 cubes by just having one variable for all of them?
Your answer
Follow this Question
Related Questions
C# ArrayList Accessing and RemoveAt? 0 Answers
Another Physics.OverlapSphere question 0 Answers
Find all plants and add their x,y,z in arrays not working. [Solved] 0 Answers
Button locking/unlocking for loop using an object array & playerprefs 1 Answer
Assigning a different material to different objects 2 Answers