# Problem with Animation of Imported Mesh

**URL:** <https://forum.babylonjs.com/t/problem-with-animation-of-imported-mesh/5663>\
**Category:** Questions\
**Created:** [September 15, 2019, 4:51pm UTC](https://forum.babylonjs.com/t/problem-with-animation-of-imported-mesh/5663 "2019-09-15T16:51:28Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![sahilnare](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sahilnare/32/43834_2.png) [@sahilnare](https://forum.babylonjs.com/u/sahilnare)\
**Post date:** [September 15, 2019, 4:51pm UTC](https://forum.babylonjs.com/t/problem-with-animation-of-imported-mesh/5663/1 "2019-09-15T16:51:28Z")

</div>

I imported a mesh and tried to play the animation but I’m unable to do so. Here’s a pic of the code and inspector:  
 ![inspector](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/0/0a39b21640247e42b1b6fd8abe904b8ff1eacf1b.png)

 ![code](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/3/3e4f0e0f8dbc187e9a8cdd4ef7244c2374a3f66c.png)  
 ![console](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/1/13405f4b55c8c53959b8b134d57463e73cdac9a4.png)

---

<div class="post-metadata">

**Author:** ![Dad72](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/dad72/32/13_2.png) [@Dad72](https://forum.babylonjs.com/u/Dad72)\
**Post date:** [September 15, 2019, 10:08pm UTC](https://forum.babylonjs.com/t/problem-with-animation-of-imported-mesh/5663/2 "2019-09-15T22:08:42Z")

</div>

I do not know why it does not work, I never work with AnimationGroups yet.

I use createAnimationRange(), beginAnimation() instead

An example that I had done a long time ago. I copied the animations of a skelette to apply them on another model. I do not know if that can help you.  
[https://www.babylonjs-playground.com/#GA8XI#12](https://www.babylonjs-playground.com/#GA8XI#12)

Sorry for not being able to help anymore, I do not know how to use AnimationGroups.

---

<div class="post-metadata">

**Author:** ![sahilnare](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sahilnare/32/43834_2.png) [@sahilnare](https://forum.babylonjs.com/u/sahilnare)\
**Post date:** [September 15, 2019, 10:16pm UTC](https://forum.babylonjs.com/t/problem-with-animation-of-imported-mesh/5663/3 "2019-09-15T22:16:21Z")

</div>

Okay. I’ll try something simpler.

---

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [September 15, 2019, 11:17pm UTC](https://forum.babylonjs.com/t/problem-with-animation-of-imported-mesh/5663/4 "2019-09-15T23:17:11Z")

</div>

Are you able to see animations after uploading the model to Sanbox?

---

<div class="post-metadata">

**Author:** ![sahilnare](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sahilnare/32/43834_2.png) [@sahilnare](https://forum.babylonjs.com/u/sahilnare)\
**Post date:** [September 15, 2019, 11:22pm UTC](https://forum.babylonjs.com/t/problem-with-animation-of-imported-mesh/5663/5 "2019-09-15T23:22:17Z")

</div>

Yes I am able to see it. I figured out the solution:

 ![solution](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/0/054f136994731ab68f8bd9ab8a08ec2cb131bc50.png)

scene.animationGroups[3].play(true); \<— For the animation that you want to play!

---

<div class="post-metadata">

**Author:** ![MarianG](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mariang/32/138_2.png) [@MarianG](https://forum.babylonjs.com/u/MarianG)\
**Post date:** [September 16, 2019, 8:28am UTC](https://forum.babylonjs.com/t/problem-with-animation-of-imported-mesh/5663/6 "2019-09-16T08:28:12Z")

</div>

True parameter is for loop, it should work without it too, but will run the animation only once 😋

---

<div class="post-metadata">

**Author:** ![Dad72](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/dad72/32/13_2.png) [@Dad72](https://forum.babylonjs.com/u/Dad72)\
**Post date:** [September 16, 2019, 9:54am UTC](https://forum.babylonjs.com/t/problem-with-animation-of-imported-mesh/5663/7 "2019-09-16T09:54:59Z")

</div>

Before, your animations were played once and you did not have time to see the animation before the model was fully loaded.  
Now adding the parameter true, the animation is looped, so therefore continues once your model loads. It seemed strange to me that it does not work.

---

<div class="post-metadata">

**Author:** ![sahilnare](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sahilnare/32/43834_2.png) [@sahilnare](https://forum.babylonjs.com/u/sahilnare)\
**Post date:** [September 16, 2019, 3:00pm UTC](https://forum.babylonjs.com/t/problem-with-animation-of-imported-mesh/5663/8 "2019-09-16T15:00:04Z")

</div>

Oh yeah. My mistake, haha.

---

<div class="post-metadata">

**Author:** ![sahilnare](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sahilnare/32/43834_2.png) [@sahilnare](https://forum.babylonjs.com/u/sahilnare)\
**Post date:** [September 16, 2019, 3:00pm UTC](https://forum.babylonjs.com/t/problem-with-animation-of-imported-mesh/5663/9 "2019-09-16T15:00:28Z")

</div>

Yeah. Pretty stupid of me, lol.
