Is there a way to remove an object from the scene?
removeObjectFromScene = (position) => {
this.scene.traverse((child) => {
if (child.isGroup && child.userData.position) {
if (child.userData.position.equals(position)) {
console.log(child.name);
this.scene.remove(child);
}
}
});
}
Encountering an issue:
object_113
Uncaught TypeError: children[i] is undefined
traverse three.module.js:7944
I would appreciate any suggestions on how to resolve this problem. Thank you.