My THREE.Group() contains numerous LODs and I need to remove all the objects within it. The group includes Lights, LensFlare, other Groups, Points, Lines, and Meshes totaling around 350 items.
systemGroup.traverse (function (obj){
systemGroup.remove(obj);
});
While this code successfully removes 175 objects, I encountered an error:
Uncaught TypeError: Cannot read property 'traverse' of undefined
on the first line of my code example.
I also attempted
scene.remove(systemGroup);
This solution works, but new objects added to the group do not erase the previous ones. I want to completely clear the group to start fresh, both for performance reasons and because I frequently fill it with many objects.
Any help is greatly appreciated.