I am removing some specific meshes from the model, but it gives error :-
Am doing this
this.bike.traverse((child) => { if (child instanceof THREE.Mesh) { if (child.name === "polySurface1") { child.material.dispose(); child.geometry.dispose(); child.parent.remove(child); console.log("1", child); this.experience.renderer.instance.renderLists.dispose(); } if (child.name === "polySurface2") { child.material.dispose(); child.geometry.dispose(); child.parent.remove(child); console.log("2", child); this.experience.renderer.instance.renderLists.dispose(); } }});
But its giving error:-
Uncaught TypeError: Cannot read properties of undefined (reading ‘traverse’)
at Group.traverse (three.module.js:7690:18)
at Group.traverse (three.module.js:7690:18)
Can anyone help regarding this?