How to tell multiple objects in scene to do something using Arrays

Let’s create 3 cubes in scene. Then, lets add these cubes to my array.

If I want to turn them off, I can now do it for each element in my array.

This is really cool because now we can make all elements let’s say within a blast zone turn off, take damage, or do whatever we want!

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Al Heck

Unity Developer and Software Engineer who loves making games with GameDevHQ