# Morph target animation freezes when played for the first time

**URL:** <https://forum.babylonjs.com/t/morph-target-animation-freezes-when-played-for-the-first-time/24248>\
**Category:** Bugs\
**Tags:** animation, gltf\
**Created:** [October 1, 2021, 1:53pm UTC](https://forum.babylonjs.com/t/morph-target-animation-freezes-when-played-for-the-first-time/24248 "2021-10-01T13:53:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![starrabb1t](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/starrabb1t/32/18946_2.png) [@starrabb1t](https://forum.babylonjs.com/u/starrabb1t)\
**Post date:** [October 1, 2021, 1:53pm UTC](https://forum.babylonjs.com/t/morph-target-animation-freezes-when-played-for-the-first-time/24248/1 "2021-10-01T13:53:11Z")

</div>

I have GLTF file exported from Blender with both morph target animation and skeletal (human head)

- Expected result:  
both of animations play smoothly
- Current result:  
morph target animation freezes when played for the first time, then plays smoothly at the next launch (`.play()` call). This does not depend from device or browser

Do you have any idea what it could be? Buffering? Some workarounds to fix this?

**Additional context**  
Also noticed that if you pre-execute `scene.freezeActiveMeshes()` animation plays smoothly, but skeletal animation doesn’t work

---

<div class="post-metadata">

**Author:** ![PirateJC](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/piratejc/32/1003_2.png) [@PirateJC](https://forum.babylonjs.com/u/PirateJC)\
**Post date:** [October 1, 2021, 9:16pm UTC](https://forum.babylonjs.com/t/morph-target-animation-freezes-when-played-for-the-first-time/24248/2 "2021-10-01T21:16:46Z")

</div>

Hey @starrabb1t

First and foremost, welcome to the Babylon family! It’s sincerely awesome to have you join us!

As a general rule around here, we ask everyone to supply playground examples when asking questions or troubleshooting. This helps us tremendously as we can pass specific solutions back and forth and get to resolutions faster.

If possible it would be awesome if you could provide a playground?

That said, try this:

yourLoadedMesh.morphTargetManager.optimizeInfluencers = false;

There’s an optimization that we do related to getting the scene ready for morphTarget animations. I’m not 100% familiar with it, but I believe this line of code should help.

Also adding @Evgeni_Popov to fill in for my ignorance and help explain the specifics of this.

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [October 1, 2021, 9:48pm UTC](https://forum.babylonjs.com/t/morph-target-animation-freezes-when-played-for-the-first-time/24248/3 "2021-10-01T21:48:30Z")

</div>

A repo in the Playground would help indeed. `optimizeInfluencers` has an effect only if `target.influence == 0`, I don’t know if that is your case(?)

> [@starrabb1t](#):
>
> Also noticed that if you pre-execute `scene.freezeActiveMeshes()` animation plays smoothly, but skeletal animation doesn’t work

That’s expected, when meshes are frozen the skeletons are not updated anymore. See [Freeze Active Meshes and animations - #2 by Evgeni\_Popov](https://forum.babylonjs.com/t/freeze-active-meshes-and-animations/7713/2)

---

<div class="post-metadata">

**Author:** ![starrabb1t](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/starrabb1t/32/18946_2.png) [@starrabb1t](https://forum.babylonjs.com/u/starrabb1t)\
**Post date:** [October 2, 2021, 11:53am UTC](https://forum.babylonjs.com/t/morph-target-animation-freezes-when-played-for-the-first-time/24248/4 "2021-10-02T11:53:21Z")

</div>

Thank you very much! It worked!  
And thanks for your amiability, I’m glad to join community:)

---

<div class="post-metadata">

**Author:** ![starrabb1t](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/starrabb1t/32/18946_2.png) [@starrabb1t](https://forum.babylonjs.com/u/starrabb1t)\
**Post date:** [October 2, 2021, 11:54am UTC](https://forum.babylonjs.com/t/morph-target-animation-freezes-when-played-for-the-first-time/24248/5 "2021-10-02T11:54:15Z")

</div>

Thank you! That was my case exactly)
