# After alpha 24 all animation methods stop working

**URL:** <https://forum.babylonjs.com/t/after-alpha-24-all-animation-methods-stop-working/22228>\
**Category:** Questions\
**Created:** [July 7, 2021, 6:13pm UTC](https://forum.babylonjs.com/t/after-alpha-24-all-animation-methods-stop-working/22228 "2021-07-07T18:13:48Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![br-matt](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/br-matt/32/22436_2.png) [@br-matt](https://forum.babylonjs.com/u/br-matt)\
**Post date:** [July 7, 2021, 6:13pm UTC](https://forum.babylonjs.com/t/after-alpha-24-all-animation-methods-stop-working/22228/1 "2021-07-07T18:13:48Z")

</div>

I was wondering if anything in general changed about triggering code based animations for modules ? Some side effect that needs to be imported maybe ?

Same code and after alpha 24 `CreateAndStartAnimation`, `TransitionTo` and `new Animation(...` stop working in multiple places in our app.

Unfortunately it seems to be fine in PG so far, will keep trying to repro.

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [July 7, 2021, 7:40pm UTC](https://forum.babylonjs.com/t/after-alpha-24-all-animation-methods-stop-working/22228/2 "2021-07-07T19:40:12Z")

</div>

Ohhhhhh that sounds pretty bad ☹ Would you happen to have a small github repro ? I would like to fix it ASAP as I can not think of anything we changed regarding animations ☹

---

<div class="post-metadata">

**Author:** ![br-matt](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/br-matt/32/22436_2.png) [@br-matt](https://forum.babylonjs.com/u/br-matt)\
**Post date:** [July 7, 2021, 7:58pm UTC](https://forum.babylonjs.com/t/after-alpha-24-all-animation-methods-stop-working/22228/3 "2021-07-07T19:58:18Z")

</div>

Okay I will get one up soon and update here 🙂

---

<div class="post-metadata">

**Author:** ![br-matt](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/br-matt/32/22436_2.png) [@br-matt](https://forum.babylonjs.com/u/br-matt)\
**Post date:** [July 8, 2021, 6:02pm UTC](https://forum.babylonjs.com/t/after-alpha-24-all-animation-methods-stop-working/22228/4 "2021-07-08T18:02:17Z")

</div>

@sebavan Despite [my best efforts ay creating a repro](https://github.com/code-matt/BabylonRepro) I could not get it. I am testing in our app with just a box and animation like the example there.

The only clue I got out of the exercise is that in the working example, the animatable returned has a value for `_localDelayOffset` always increasing each time CreateAndStartAnimation is called.

The animateables returned in our app stay `null`.

Does that small insight about \_localDelayOffset give you any ideas ?

Edit: I was digging through the source some and checked `scene._activeAnimatables`. It’s filling up and never emptying out. ( I have CreateAndStartAnimation on a setInterval )

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [July 8, 2021, 6:36pm UTC](https://forum.babylonjs.com/t/after-alpha-24-all-animation-methods-stop-working/22228/5 "2021-07-08T18:36:37Z")

</div>

This is really weird and I can not find an animation playground broken from the doc ☹

Maybe @Deltakosh would have an idea ?

---

<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:** [July 8, 2021, 6:49pm UTC](https://forum.babylonjs.com/t/after-alpha-24-all-animation-methods-stop-working/22228/6 "2021-07-08T18:49:53Z")

</div>

Nope and I did not find any related recent changes

---

<div class="post-metadata">

**Author:** ![br-matt](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/br-matt/32/22436_2.png) [@br-matt](https://forum.babylonjs.com/u/br-matt)\
**Post date:** [July 8, 2021, 7:39pm UTC](https://forum.babylonjs.com/t/after-alpha-24-all-animation-methods-stop-working/22228/7 "2021-07-08T19:39:14Z")

</div>

I am really digging through the history here 😃 I found this issue [In Animatable.prototype.\_animate - sometimes the variable \_previousRatio and \_ratioOffset contains NaN · Issue #4203 · BabylonJS/Babylon.js · GitHub](https://github.com/BabylonJS/Babylon.js/issues/4203)

It seems like it was resolved but @Deltakosh in our app i’m seeing  
 ![Screen Shot 2021-07-08 at 3.34.37 PM](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/9/1/91f5d7721b8c30e80b41ce08ebbb05276732b42a.png)

I don’t understand much what this value is for yet, any ideas ? Downgrading back to alpha24 and this has a value/animations work.

---

<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:** [July 8, 2021, 9:50pm UTC](https://forum.babylonjs.com/t/after-alpha-24-all-animation-methods-stop-working/22228/8 "2021-07-08T21:50:58Z")

</div>

Is there any way you could share the animation or the code you use? We are not seeing this issue ☹

---

<div class="post-metadata">

**Author:** ![br-matt](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/br-matt/32/22436_2.png) [@br-matt](https://forum.babylonjs.com/u/br-matt)\
**Post date:** [July 8, 2021, 10:20pm UTC](https://forum.babylonjs.com/t/after-alpha-24-all-animation-methods-stop-working/22228/9 "2021-07-08T22:20:59Z")

</div>

for testing I have right now:

```auto
        let box = Mesh.CreateBox("box", 1, scene, true)
        let posx = camera.position.x
        let posz = camera.position.z - 2
        box.position.set(posx, 1, posz)

         setInterval(() => {
             let animateable = Animation.CreateAndStartAnimation("boxmove", box, "position", 30, 30, box.position, new Vector3(posx, 3 * Math.random(), posz), Animation.ANIMATIONLOOPMODE_RELATIVE)
         }, 1000)

```

I know its very weird, I do not see it in standalone repro above (added two scenes as well, thinking that might have something to do with it) or playground either. It’s something on our end combined with something thats changed in Babylon it seems. Given can flip versions to repro/not.

I am down to messing with the source as a local module now, will let you know if I come up with anything.

---

<div class="post-metadata">

**Author:** ![br-matt](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/br-matt/32/22436_2.png) [@br-matt](https://forum.babylonjs.com/u/br-matt)\
**Post date:** [July 9, 2021, 4:19pm UTC](https://forum.babylonjs.com/t/after-alpha-24-all-animation-methods-stop-working/22228/10 "2021-07-09T16:19:55Z")

</div>

@sebavan @Deltakosh I found something

in `node_modules/@babylonjs/core/Animations/animatable.js`

if I comment out:

```auto
        // if (this._pendingData.length > 0) {
        // return;
        // }

```

animations start working again on version \> 24 🚀 Still don’t understand exactly what is causing it though. Does this help at all ?

---

<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:** [July 9, 2021, 4:39pm UTC](https://forum.babylonjs.com/t/after-alpha-24-all-animation-methods-stop-working/22228/11 "2021-07-09T16:39:58Z")

</div>

This means that you have data not loaded yet. The pendingData property of the scene indicates that you cannot launch animation as not everything is loaded and ready.

You can forcefully empty that array but I would recommend to check what is not loaded yet.

The goal is to avoid hiccups in the animations because if something is done loaded while the animation was started it will force a frame or 2 to drop and thus the animation will not be smooth

---

<div class="post-metadata">

**Author:** ![br-matt](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/br-matt/32/22436_2.png) [@br-matt](https://forum.babylonjs.com/u/br-matt)\
**Post date:** [July 9, 2021, 5:01pm UTC](https://forum.babylonjs.com/t/after-alpha-24-all-animation-methods-stop-working/22228/12 "2021-07-09T17:01:17Z")

</div>

Thanks, after waiting and all loading finished, that is always filled up with 26 `InternalTexture` that seem stuck there, definitely something to look into next for me 🙂

---

<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:** [July 9, 2021, 5:31pm UTC](https://forum.babylonjs.com/t/after-alpha-24-all-animation-methods-stop-working/22228/13 "2021-07-09T17:31:28Z")

</div>

Oh yes 🙂 That smells like a leak to me 😃

---

<div class="post-metadata">

**Author:** ![br-matt](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/br-matt/32/22436_2.png) [@br-matt](https://forum.babylonjs.com/u/br-matt)\
**Post date:** [July 9, 2021, 10:23pm UTC](https://forum.babylonjs.com/t/after-alpha-24-all-animation-methods-stop-working/22228/14 "2021-07-09T22:23:39Z")

</div>

@Deltakosh Is that check on the length something put in after alpha 24 or did anything change in alpha25 you know of that would cause `InternalTexture` to stay stuck in that array ?

---

<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:** [July 9, 2021, 10:36pm UTC](https://forum.babylonjs.com/t/after-alpha-24-all-animation-methods-stop-working/22228/15 "2021-07-09T22:36:44Z")

</div>

Nothing come to mind honestly:( pinging @Evgeni_Popov if he remembers something along this line

Ideally if you could repro in the PG I would be able to fix it in 20s:(

---

<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:** [July 9, 2021, 11:30pm UTC](https://forum.babylonjs.com/t/after-alpha-24-all-animation-methods-stop-working/22228/16 "2021-07-09T23:30:08Z")

</div>

I really don’t know.

The check on the length does exist for at least 2 years, so it’s not the problem.

Only `createRawCubeTextureFromUrl` and `_createTextureBase` are adding an `InternalTexture` instance in the pending array. So the problem would be either the `_pendingData` is not properly cleaned in some cases, or some textures don’t finish loading… Have you checked in the network tab that there’s no HTTP requests pending that never finishes?

---

<div class="post-metadata">

**Author:** ![br-matt](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/br-matt/32/22436_2.png) [@br-matt](https://forum.babylonjs.com/u/br-matt)\
**Post date:** [July 9, 2021, 11:49pm UTC](https://forum.babylonjs.com/t/after-alpha-24-all-animation-methods-stop-working/22228/17 "2021-07-09T23:49:20Z")

</div>

Hmm, just checked, no pending requests in network tab.

I will do my best to start loading and unloading some glbs in my attempted github repro, now that is seems something to do with textures.

---

<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:** [July 12, 2021, 3:21pm UTC](https://forum.babylonjs.com/t/after-alpha-24-all-animation-methods-stop-working/22228/18 "2021-07-12T15:21:59Z")

</div>

Can you somehow share a simple repro with the debug bits somewhere?

---

<div class="post-metadata">

**Author:** ![br-matt](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/br-matt/32/22436_2.png) [@br-matt](https://forum.babylonjs.com/u/br-matt)\
**Post date:** [July 20, 2021, 5:33pm UTC](https://forum.babylonjs.com/t/after-alpha-24-all-animation-methods-stop-working/22228/19 "2021-07-20T17:33:22Z")

</div>

Thank you @Evgeni_Popov for the fix 😃 I don’t know if I ever would have found this, its been a wild ride looking.

The fix from here: [Texture Gamma Space + Node Materials - #10 by Evgeni\_Popov](https://forum.babylonjs.com/t/texture-gamma-space-node-materials/22455/10)

is what ended up fixing animations by the pendingData not being filled with InternalTexture(s)

```auto
    SceneLoader.OnPluginActivatedObservable.add(function (loader) {
        if (loader.name === "gltf") {
            loader.useSRGBBuffers = false;
        }
    });

```

ultimately what fixed it

---

<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:** [July 20, 2021, 9:02pm UTC](https://forum.babylonjs.com/t/after-alpha-24-all-animation-methods-stop-working/22228/20 "2021-07-20T21:02:10Z")

</div>

That’s quite strange, as using sRGB buffers should not make a difference… Maybe it’s an interaction with your custom glTF extension?

[Next page](https://forum.babylonjs.com/t/after-alpha-24-all-animation-methods-stop-working/22228.md?page=2)
