renderer.enabled but not visible

hi folks, quick question. I set for several object renderer.enabled = true in a routine (not in Update), some objects that were previously visible are, but objects that were not visible before do not appear and when I check isVisible it’s false.

Why would renderer.enabled be true but isVisible return false??

Thanks in advance

renderer.enabled controls whether the object can be rendered or not, while renderer.isVisible returns true when the object is inside the view frustum of any active camera. If the renderer is enabled but the object isn’t in front of any camera, isVisible returns false. Conversely, an object inside the view frustum will return isVisible=true, even if it’s behind other objects and can’t actually be seen.

objects are made visible through the attached mesh rendender

//is made visible

gameobject.getcomponent<MeshRenderer>().enabled = true;

ensure an attached mesh renderer component prior to trying to mess with it or you’ll get a null reference exception.

mark as answered. :slight_smile: