0
votes

I have a THREE.Group() and in it are alot of LODs and i want to get rid of all the objects in this group. There are Lights, LensFlare, other Groups, Points, Lines and Meshs inside. Like 350 of them.

systemGroup.traverse (function (obj){
    systemGroup.remove(obj);
});

It removes 175 of it and after that i get

Uncaught TypeError: Cannot read property 'traverse' of undefined

for the line one in my example code here.

I also tried

scene.remove(systemGroup);

Which works well but when i fill my group with other objects, the old ones are still there. I want everthing to be gone in this group to start like from the beginning. Also for performance because i want to fill it often with lots of stuff.

Thanks for every help.

1

1 Answers

0
votes

"Uncaught TypeError: Cannot read property 'traverse' of undefined"

It looks like systemGroup is not defined in the context you are calling this from.

Check where systemGroup is defined, what context you are calling systemGroup.traverse from, and also your spelling/capitalization. If none of that works you might need to post your full code to get a valuable answer.