Threejs How to Make an Object Invisible

2020.10.26 | 122 words |


I’m using threejs to create an audiovisualizer to accompany the release of an upcoming music track. As part of this, I want to be able to make an object invisible (and then to make it visible again). How can I make an object visible and invisible in threejs?


Most objects in threejs (assuming you’re in 3D mode) are an Object3D. These objects have a property on them called visible that lets the renderer know whether or not they should be rendered - setting this determines whether or not they actually appear, thus rendering them visible or invisible.

To make an object visible or invisible, set the visible field on it to true or false

invisibleObject.visible = false
visibleObject.visible = true

About the Ham

Hi I'm Hamilton - I built this! If you want more content like this subscribe to my email list, connect with me around the web, or take a look at some of my other projects.

More Projects

comments powered by Disqus