I found this
This doesn’t deal with children but I imagine I could do
if (this.oldMesh && this.oldMesh.getChildren) {
const children = this.oldMesh.getChildren();
children.forEach(child => {
child.parent = newMesh; // Transfer each child to new mesh
});
}
But then I’m worried about race conditions if I try to do this for multiple meshes at the same time, especially if they are in the same hierarchy structure. Is there a standard way to replace a mesh?