Using Three.js:
I have a method called removeBysid(id)
My goal is to access the unique sid
of the third child's treeNode
in my scene by traversing through all the children.
When I run the following command in the console:
scene.children[4].children[0].children[0].treeNode
I successfully retrieve the desired result for my function.
Now, I need a function that can iterate through all the scene's children without relying on hardcoded indices like I did when testing in the console.
function removeBysid(id) {
scene.traverse(function(element) {
//element returns Scene {uuid: "AC30E121-517A-40F9-8F86-F3626003A3C7", name: "", type: "Scene", parent: null, //children: Array(6)…}
})
}