# Cloning loaded animated mesh

**URL:** https://discourse.threejs.org/t/cloning-loaded-animated-mesh/57500
**Category:** Questions
**Tags:** animation
**Created:** [October 27, 2023, 6:01pm UTC](https://discourse.threejs.org/t/cloning-loaded-animated-mesh/57500 "2023-10-27T18:01:14Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Upgrayedd](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/upgrayedd/32/38570_2.png) [@Upgrayedd](https://discourse.threejs.org/u/Upgrayedd)
#### Post date: [October 27, 2023, 6:01pm UTC](https://discourse.threejs.org/t/cloning-loaded-animated-mesh/57500/1 "2023-10-27T18:01:14Z")

</div>

I don’t know if it’s a bug, but cloning SkinnedMesh which is loaded from .glb file does not work for me. I see that in documentation [three.js docs](https://threejs.org/docs/#api/en/objects/SkinnedMesh.clone) it is suggested to use SkeletonUtils.clone method, but it gives me an error `Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'matrixWorld')`. In console log I see that skeleton of cloned mesh has bones property as array of undefined objects. What I’m missing?

https://codepen.io/upgreidas/embed/preview/ExrPjda?default-tabs=js%2Cresult&height=300&host=https%3A%2F%2Fcodepen.io&slug-hash=ExrPjda

 ![undefined](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/8/1/812362873b2c8c17837ef09a8fa955a055e688e3.png)

---

<div class="post-metadata">

### Author: ![makc3d](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/makc3d/32/10452_2.png) [@makc3d](https://discourse.threejs.org/u/makc3d)
#### Post date: [October 27, 2023, 8:19pm UTC](https://discourse.threejs.org/t/cloning-loaded-animated-mesh/57500/2 "2023-10-27T20:19:38Z")

</div>

most likely it’s unhappy that the bones are not in the hierarchy of the object you are trying to clone (arms)

---

<div class="post-metadata">

### Author: ![manthrax](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/manthrax/32/2596_2.png) [@manthrax](https://discourse.threejs.org/u/manthrax)
#### Post date: [October 28, 2023, 1:21am UTC](https://discourse.threejs.org/t/cloning-loaded-animated-mesh/57500/3 "2023-10-28T01:21:48Z")

</div>

Specifically… you need to call SkeletonUtils.clone( ) on a node that contains Both the SkinnedMesh, and all the relevant Bones beneath it.

So…

TheScene–\>[  
Bone1,Bone2,Bone3,  
TheSkinnnedMesh  
]

will fail if you call SkinnedMeshUtils.clone( TheSkinnedMesh )

but will succeed if you call SkinnedMeshUtils.clone( TheScene )
