hide show objects

Hi,
I was searching through the documentation but I can’t find a command to hide and show a object. I know it must be in there somewhere but I just don’t know the name of the function(s).

So what I basically want to do is have a boolean for a object something like bool visible = true; so I can toggle an object from being rendered or not.

Any suggestions?

Thanks in advance

Hey,
You need to turn off its renderer object. Use GetComponent to get objects renderer object and then:

renderer.enabled = false; // make the object invisible!

Thank you :smile:

I have been trying to do the same thing. I no very little about structuring code and was wondering if you could post your script for reference. I am trying to make GUI toggle buttons that correspond to different design alternatives for my visualization project and when selected they would render on and off.