I have a GLB file which has the following node hierarchy:
“root”
|------mesh1
|------mesh2
|------mesh3
Now I’d like to create a clone
BABYLON.SceneLoader.ImportMesh("", "https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/Avocado/glTF-Binary/", "Avocado.glb", scene, function (importedMeshes) {
const root = importedMeshes[0];
let clone = root.clone("cloned");
clone.position = BABYLON.Vector3(-1,0,0);
});
But I get an error
See playground https://playground.babylonjs.com/#0JXS5F#1
What is the correct way of cloning the entire GLB asset?