# meshTask + clone + animationGroups

**URL:** <https://forum.babylonjs.com/t/meshtask-clone-animationgroups/12424>\
**Category:** Questions\
**Created:** [July 12, 2020, 4:57pm UTC](https://forum.babylonjs.com/t/meshtask-clone-animationgroups/12424 "2020-07-12T16:57:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![supershwa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/supershwa/32/7039_2.png) [@supershwa](https://forum.babylonjs.com/u/supershwa)\
**Post date:** [July 12, 2020, 4:57pm UTC](https://forum.babylonjs.com/t/meshtask-clone-animationgroups/12424/1 "2020-07-12T16:57:29Z")

</div>

I’m trying to figure out how to clone a mesh and the animationGroup for use in duplicate meshes throughout the world while using addMeshTask from the assetManager.

Here’s a PG: [https://playground.babylonjs.com/#ZQPDEF#12](https://playground.babylonjs.com/#ZQPDEF#12)

I can’t figure out how to clone the animationGroup properly for use in the second (cloned) mesh.

Thanks!

---

<div class="post-metadata">

**Author:** ![gbz](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/gbz/32/23780_2.png) [@gbz](https://forum.babylonjs.com/u/gbz)\
**Post date:** [July 13, 2020, 7:39am UTC](https://forum.babylonjs.com/t/meshtask-clone-animationgroups/12424/2 "2020-07-13T07:39:24Z")

</div>

I’m not sure how this can be done using AnimationGroup, which is why I switched to using Skeletons and AnimationRanges imported from .babylon files, as shown in the demo: [Dancers Performance demo](https://www.babylonjs.com/demos/dancers/). You can view the source code inside the .html file in the tag.

---

<div class="post-metadata">

**Author:** ![Shaft\_Dg](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/shaft_dg/32/10712_2.png) [@Shaft\_Dg](https://forum.babylonjs.com/u/Shaft_Dg)\
**Post date:** [July 13, 2020, 8:19am UTC](https://forum.babylonjs.com/t/meshtask-clone-animationgroups/12424/3 "2020-07-13T08:19:23Z")

</div>

[https://playground.babylonjs.com/#ZQPDEF#18](https://playground.babylonjs.com/#ZQPDEF#18)

add method “addContainerTask” for BABYLON.AssetsManager (lines: 1 - 57)  
use method “addContainerTask” (line: 83)

managing loaded object (lines: 107 - 114)

read this documentation:  
[https://doc.babylonjs.com/how\_to/load\_from\_any\_file\_type](https://doc.babylonjs.com/how_to/load_from_any_file_type)  
[https://doc.babylonjs.com/how\_to/how\_to\_use\_assetcontainer](https://doc.babylonjs.com/how_to/how_to_use_assetcontainer)

---

<div class="post-metadata">

**Author:** ![supershwa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/supershwa/32/7039_2.png) [@supershwa](https://forum.babylonjs.com/u/supershwa)\
**Post date:** [July 13, 2020, 3:16pm UTC](https://forum.babylonjs.com/t/meshtask-clone-animationgroups/12424/4 "2020-07-13T15:16:38Z")

</div>

Thank you, @gbz and @Shaft_Dg, for these elegant demos and solutions!

---

<div class="post-metadata">

**Author:** ![supershwa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/supershwa/32/7039_2.png) [@supershwa](https://forum.babylonjs.com/u/supershwa)\
**Post date:** [July 13, 2020, 4:34pm UTC](https://forum.babylonjs.com/t/meshtask-clone-animationgroups/12424/5 "2020-07-13T16:34:05Z")

</div>

To follow up, I was able to successfully implement the solution provided by @Shaft_Dg to solve the issue. Thanks again!

---

<div class="post-metadata">

**Author:** ![fliptrail](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/fliptrail/32/26879_2.png) [@fliptrail](https://forum.babylonjs.com/u/fliptrail)\
**Post date:** [September 12, 2022, 9:36am UTC](https://forum.babylonjs.com/t/meshtask-clone-animationgroups/12424/6 "2022-09-12T09:36:59Z")

</div>

This is so good, this should be in the documentation. Saved my day after I was trying to manually clone Transform Nodes for an animated modular mesh.
