Cloning GLB Meshes results in error

I have a GLB file which has the following node hierarchy:

Now I’d like to create a clone

BABYLON.SceneLoader.ImportMesh("", "", "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

What is the correct way of cloning the entire GLB asset?

You were missing the “new” keyword in the Vector3 creation line 23, so it was not creating the correct object :slight_smile: Cloning GLTF Files | Babylon.js Playground (


Aww…snap. Thanks for the keen eye @carolhmj

1 Like