Quantcast
Channel: Questions in topic: "renderer.enabled"
Viewing all articles
Browse latest Browse all 99

Make multiple objects renderer off

$
0
0
Hi, i've come into a problem of having to turn off the renderer of multiple objects. What I mean by that is i've downloaded a model and in the prefab there are a large amount of objects each with a Mesh renderer and i'm wondering how to turn all of them off at once. If even possible. I've tried using> 1. var popup : GameObject[];> 2. var trigger : GameObject;> 3. function OnTriggerEnter(col : Collider){> 4. if(col.tag == "Player"){> 5. popup.renderer.enabled = true;> 6. }> 7. }> 8. function OnTriggerExit(){> 9. popup.renderer.enabled = false;> 10. Destroy(trigger);> 11. } and ends up saying "Assets/aScript/Popupp.js(13,15): BCE0019: 'renderer' is not a member of 'UnityEngine.GameObject[]'. " is there any possible way of actually doing what i'm trying to do? I'm willing to provide more details if needed.

Viewing all articles
Browse latest Browse all 99

Trending Articles



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