# How to clone a GLB model and play seperate animation on each clone?

**URL:** <https://forum.babylonjs.com/t/how-to-clone-a-glb-model-and-play-seperate-animation-on-each-clone/2351>\
**Category:** Questions\
**Created:** [April 3, 2019, 11:06pm UTC](https://forum.babylonjs.com/t/how-to-clone-a-glb-model-and-play-seperate-animation-on-each-clone/2351 "2019-04-03T23:06:12Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![bnolan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bnolan/32/1556_2.png) [@bnolan](https://forum.babylonjs.com/u/bnolan)\
**Post date:** [April 3, 2019, 11:06pm UTC](https://forum.babylonjs.com/t/how-to-clone-a-glb-model-and-play-seperate-animation-on-each-clone/2351/1 "2019-04-03T23:06:12Z")

</div>

Heya,

I’ve managed to make a .glb file which contains 5 animations plus the player avatar. I can import the .glb ok, and have worked out how to clone the avatar mesh, but I can’t work out how to play a seperate animation on each clone of the avatar.

Here is the playground - each of the avatars should be playing a seperate animation on loop.

[https://playground.babylonjs.com/#AJA5J6#2](https://playground.babylonjs.com/#AJA5J6#2)

Been scratching my head at this for a few days, thanks for your help. 🙂 🙂 🙂

Ben  
[www.cryptovoxels.com](http://www.cryptovoxels.com)

---

<div class="post-metadata">

**Author:** ![bnolan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bnolan/32/1556_2.png) [@bnolan](https://forum.babylonjs.com/u/bnolan)\
**Post date:** [April 3, 2019, 11:08pm UTC](https://forum.babylonjs.com/t/how-to-clone-a-glb-model-and-play-seperate-animation-on-each-clone/2351/2 "2019-04-03T23:08:46Z")

</div>

Things that confused me:

- The skeleton doesn’t have an `animations` property - which it does have in the docs.
- I can’t work out how to add an instance of the avatar to an animationGroup
- Using babylon 3.3, when I import the avatar I get multiple meshes, but the 4.0 importer seems to bring in only one mesh
- Using babylon 3.3, cloning the root mesh doesn’t clone the quaternion, and when I try and apply a skeleton to it, the avatar gets hideously deformed

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [April 4, 2019, 1:38am UTC](https://forum.babylonjs.com/t/how-to-clone-a-glb-model-and-play-seperate-animation-on-each-clone/2351/3 "2019-04-04T01:38:52Z")

</div>

Pinging @bghgary

---

<div class="post-metadata">

**Author:** ![bnolan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bnolan/32/1556_2.png) [@bnolan](https://forum.babylonjs.com/u/bnolan)\
**Post date:** [April 4, 2019, 2:02am UTC](https://forum.babylonjs.com/t/how-to-clone-a-glb-model-and-play-seperate-animation-on-each-clone/2351/4 "2019-04-04T02:02:02Z")

</div>

Ok, got a bit closer! I’m cloning the animation group which is working, but all the meshes are horribly deformed now. Poor art mannequin man.

[https://playground.babylonjs.com/#AJA5J6#4](https://playground.babylonjs.com/#AJA5J6#4)

![55%20PM](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/2/2a81f6027f9943caa1c640bc9afc4e4296945086.png)

---

<div class="post-metadata">

**Author:** ![bnolan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bnolan/32/1556_2.png) [@bnolan](https://forum.babylonjs.com/u/bnolan)\
**Post date:** [April 4, 2019, 2:47am UTC](https://forum.babylonjs.com/t/how-to-clone-a-glb-model-and-play-seperate-animation-on-each-clone/2351/5 "2019-04-04T02:47:41Z")

</div>

Hmm weird - it seems like all the animations are playing properly to the skeleton - but the maybe the bone weights on the model got messed up by the clone? 😕

Are the bone indexes somehow messed up?

![53%20PM](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/5/5460490b70eba0a1706496a493687297b0fc8c99.png)

---

<div class="post-metadata">

**Author:** ![Givo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/givo/32/4968_2.png) [@Givo](https://forum.babylonjs.com/u/Givo)\
**Post date:** [April 4, 2019, 2:58am UTC](https://forum.babylonjs.com/t/how-to-clone-a-glb-model-and-play-seperate-animation-on-each-clone/2351/6 "2019-04-04T02:58:59Z")

</div>

Unrelated but hey! Your the Cryptovoxels guys! I just want to say that the concept is cool, and I would love to have my own square, but I have no ethereum.

---

<div class="post-metadata">

**Author:** ![bnolan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bnolan/32/1556_2.png) [@bnolan](https://forum.babylonjs.com/u/bnolan)\
**Post date:** [April 4, 2019, 3:00am UTC](https://forum.babylonjs.com/t/how-to-clone-a-glb-model-and-play-seperate-animation-on-each-clone/2351/7 "2019-04-04T03:00:53Z")

</div>

Hey man, thanks! I’m really enjoying working on it, and babylon has been amazing to work with (this problem notwithstanding). If someone is able to fix the playground for me so that it clones and plays the animations, I’d be happy to give a parcel in the west end as a bounty!

_Bounty: 1 Parcel in the West end. 🦑_

---

<div class="post-metadata">

**Author:** ![Givo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/givo/32/4968_2.png) [@Givo](https://forum.babylonjs.com/u/Givo)\
**Post date:** [April 4, 2019, 3:01am UTC](https://forum.babylonjs.com/t/how-to-clone-a-glb-model-and-play-seperate-animation-on-each-clone/2351/8 "2019-04-04T03:01:34Z")

</div>

I am not the guy to ask to help fix the issue, but free sounds nice.

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [April 4, 2019, 4:59pm UTC](https://forum.babylonjs.com/t/how-to-clone-a-glb-model-and-play-seperate-animation-on-each-clone/2351/9 "2019-04-04T16:59:58Z")

</div>

There isn’t an easy way to clone with skeletons and animations. The easiest thing you can do is to reload the asset.

[https://playground.babylonjs.com/#AJA5J6#5](https://playground.babylonjs.com/#AJA5J6#5)

See [Make it easier to clone a mesh and start the associated animations/animationGroup · Issue #5423 · BabylonJS/Babylon.js · GitHub](https://github.com/BabylonJS/Babylon.js/issues/5423) for more info.

---

<div class="post-metadata">

**Author:** ![bnolan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bnolan/32/1556_2.png) [@bnolan](https://forum.babylonjs.com/u/bnolan)\
**Post date:** [April 4, 2019, 10:50pm UTC](https://forum.babylonjs.com/t/how-to-clone-a-glb-model-and-play-seperate-animation-on-each-clone/2351/10 "2019-04-04T22:50:09Z")

</div>

Ok thanks Gary! It’s not ideal but it’ll do for no I guess. As long as I have my caching rules set ok it hopefully won’t hit the network multiple times. 🙂

---

<div class="post-metadata">

**Author:** ![PichouPichou](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pichoupichou/32/316_2.png) [@PichouPichou](https://forum.babylonjs.com/u/PichouPichou)\
**Post date:** [May 9, 2019, 11:09pm UTC](https://forum.babylonjs.com/t/how-to-clone-a-glb-model-and-play-seperate-animation-on-each-clone/2351/11 "2019-05-09T23:09:51Z")

</div>

Hi guys, I am looking for a way to do this exact thing. I understand there is no easy way to do that except than reloading the asset for now.  
But I wonder if it might have changed with the V4 update?

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [May 10, 2019, 2:42pm UTC](https://forum.babylonjs.com/t/how-to-clone-a-glb-model-and-play-seperate-animation-on-each-clone/2351/12 "2019-05-10T14:42:36Z")

</div>

The best way is probably to reload the model instead of cloning it

---

<div class="post-metadata">

**Author:** ![HiteshSahu](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/hiteshsahu/32/50817_2.png) [@HiteshSahu](https://forum.babylonjs.com/u/HiteshSahu)\
**Post date:** [October 6, 2019, 7:14am UTC](https://forum.babylonjs.com/t/how-to-clone-a-glb-model-and-play-seperate-animation-on-each-clone/2351/13 "2019-10-06T07:14:20Z")

</div>

Any update on this, I am also facing similar issue with cloning of GLB  
[https://www.babylonjs-playground.com/#5NIBE1#7](https://www.babylonjs-playground.com/#5NIBE1#7)

for .babylon it seems to work fine

[https://www.babylonjs-playground.com/#QY1WYT#0](https://www.babylonjs-playground.com/#QY1WYT#0)

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [October 6, 2019, 1:25pm UTC](https://forum.babylonjs.com/t/how-to-clone-a-glb-model-and-play-seperate-animation-on-each-clone/2351/14 "2019-10-06T13:25:20Z")

</div>

The best option for now is to reload the glb and let the browser cache does the work for you
