Can we get an array of children in the order reflected in the hierarchy? world.GetChildren()
returns a Generator that is ordered by eid. I also tried world.three.entityToObject.get(parent).children
but that returns a similar array. They’re ordered alphabetically as name_NUMBER
, but I can’t seem to access the name to sort by.
Any pointers?
I have the same problem, bumping up this thread
An order is available as ecs.ThreeObject.get(world, eid).order
.
Keep in mind this isn’t exactly the hierarchy order but it is a way to keep track of which objects are where.
1 Like
so if I had the eid of a root entity how can I get the eid of it’s children?
for (const child of world.GetChildren()) {
console.log(child)
}
Should work
1 Like