I am interested in controlling the visibility of objects in my scene through a button on a GUI. The following function currently hides/shows objects individually:
g3white.traverse(function(child){child.visible = true;});
g3black.traverse(function(child){child.visible = false;});
While this works manually, I want to create an onChange function that will switch the visibility of the black object with the white one (and vice versa) when a button is clicked.
Any assistance you can provide would be greatly appreciated. Thank you.