How to change the Scale of all objects in an array. I did this: public GameObject [] scaler;

void Update(){ if(landscape)... 

What's next? I need to know how to access these GameObjects in an array. In the inspector, of course, drag them to the array. thank

    1 answer 1

    You can call for example like this:

     if(landscape) { foreach (var obj in scaler) { obj.transform.localScale = new Vector3(2, 2, 2); } } 

    foreach iterates through each element of the array iteratively

    instead of 2 2 2 in the assignment of course you need to set your own values ​​or variables