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
- var popup : GameObject;
- var trigger : GameObject;
- function OnTriggerEnter(col : Collider){
if(col.tag == "Player"){popup.renderer.enabled = true;- }
- }
- function OnTriggerExit(){
- popup.renderer.enabled = false;
- Destroy(trigger);
- }
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.
hi, thanks for the response, do you mind explaining this to me? I'm a bit new to scripting and don't understand what an Array is ;-; also it worked! THANK YOU SO MUCH, I'VE BEEN TRYING TO FIND AN ANSWER FOR OVER A MONTH.
– LegacyIndie