I have a question w.r.t. mesh parenting in babylon.
I think it would be the best if I explain my question based on an example:
- Assume I have a car consisting of many different objects as an array of wheels, an array of seats an lots of other stuff.
- Now, I want to move the car. So, I parent the whole structure and move it with one line of code.
- I also need to open the doors, which is not a problem as I can store the references to the sub objects and move them separately
- However, I want to clone the car (as I do have multiple copies of it in the scene)
- And again, I want to move submeshes (doors) of the copied car.
Of course, I could clone all of the children, rebuild the parenting structure, and remember the references of the cloned children.
However, I wonder if there is a more generic way for cloning a parented mesh-structure such that the children are retrievable? (maybe working with the predicate function of getChildren or similar)
Maybe someone had a similar dilemma, or how would you approach such a problem?
Thx in advance