Quantcast
Viewing latest article 2
Browse Latest Browse All 4

Answer by Kergal

I would change a couple of things. (but i use C#) . At the moment your your Array is of type component - which is weird (at least to me) . make it Transforms or GameObjects. then in your foreach loop. what do you want ? - you want to go through all the elements( that are now specified as GameObjects or Transforms ) of ourRenderer and turn them off. so I would go with foreach (GameObject temp in ourRenderer) { temp.renderer.enabled = false; } // (or SetActive(false) or something like that) however , I have not tested my approach and would -just for preference reasons use a regular for loop.

Viewing latest article 2
Browse Latest Browse All 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>