- Home /
Question by
MikezNesh · Jun 05, 2011 at 06:29 PM ·
gameobjectmeshrenderinvisible
Set an object to invisible?
How would you make a gameObject to invisible in code?
Comment
Best Answer
Answer by iggy · Jun 05, 2011 at 06:34 PM
// make the object invisible!
renderer.enabled = false;
source: http://unity3d.com/support/documentation/ScriptReference/Renderer.html
something like this:
gameObject.GetComponent(TrailRenderer).enabled=false;
Answer by PPT_HAISBMRME · Apr 07, 2018 at 04:41 PM
This has changed now you will want to do
gameObject.GetComponent<Renderer>().enabled = false;
Good job pointing that out, this actually helped me!
Your answer
![](https://koobas.hobune.stream/wayback/20220612095640im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Making a game object un-render or turn-invisible through trigger? 1 Answer
Mesh wont render/ appears invisible 4 Answers
All GameObjects are now invisible! How do I get them back? 2 Answers
Mesh slicing or shattering 1 Answer
Mesh with a face cut out 2 Answers