# Bug in CreateAndStartAnimation()

**URL:** <https://forum.babylonjs.com/t/bug-in-createandstartanimation/55975>\
**Category:** Bugs\
**Created:** [January 15, 2025, 8:07am UTC](https://forum.babylonjs.com/t/bug-in-createandstartanimation/55975 "2025-01-15T08:07:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pe443](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pe443/32/22675_2.png) [@Pe443](https://forum.babylonjs.com/u/Pe443)\
**Post date:** [January 15, 2025, 8:07am UTC](https://forum.babylonjs.com/t/bug-in-createandstartanimation/55975/1 "2025-01-15T08:07:36Z")

</div>

I may have found a bug in BABYLON.Animation.CreateAndStartAnimation().

Since 1 year I use CreateAndStartAnimation() with no problem and use Babylon-version 7.35.1 the animation with CreateAndStartAnimation() start and stop correct. Today I update my project to Babylon 7.43.0 and now the animation does no stop anymore!

Here is a playground-example which shows the bug:

> **[Babylon.js Playground](https://playground.babylonjs.com/#7J8E4T)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL and WebGPU 3D scenes

See lines 28 to 32, the camera-alpha value should animate from 0 to 1 and then stop.  
With version 7.43.0 it animates from 0-1 then from 1-2 from 2-3 and so on …

Does the function maybe have changed? I can not find some hints for that …

Thx 🙂

---

<div class="post-metadata">

**Author:** ![Joe\_Kerr](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/joe_kerr/32/39017_2.png) [@Joe\_Kerr](https://forum.babylonjs.com/u/Joe_Kerr)\
**Post date:** [January 15, 2025, 10:59am UTC](https://forum.babylonjs.com/t/bug-in-createandstartanimation/55975/2 "2025-01-15T10:59:19Z")

</div>

May be related to this: [Animation Helper - #3 by Joe\_Kerr](https://forum.babylonjs.com/t/animation-helper/55938/3) (breaking change)?

If so, better use the enum for the loop mode.

---

<div class="post-metadata">

**Author:** ![Pe443](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pe443/32/22675_2.png) [@Pe443](https://forum.babylonjs.com/u/Pe443)\
**Post date:** [January 15, 2025, 11:18am UTC](https://forum.babylonjs.com/t/bug-in-createandstartanimation/55975/3 "2025-01-15T11:18:11Z")

</div>

THX, yes with loopmode = 2 and it works again (old behavior uses 0 for no loop).

Maybe the documentation with: default loopmode = “loopmode off” may be a little bit confusion (off = 0 in most cases).

---

<div class="post-metadata">

**Author:** ![a-wit](https://avatars.discourse-cdn.com/v4/letter/a/8edcca/32.png) [@a-wit](https://forum.babylonjs.com/u/a-wit)\
**Post date:** [January 16, 2025, 4:01pm UTC](https://forum.babylonjs.com/t/bug-in-createandstartanimation/55975/4 "2025-01-16T16:01:27Z")

</div>

> [@Pe443](#):
>
> loopmode

I have also encountered the same problem, is there a solution

---

<div class="post-metadata">

**Author:** ![roland](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/roland/32/38940_2.png) [@roland](https://forum.babylonjs.com/u/roland)\
**Post date:** [January 16, 2025, 7:33pm UTC](https://forum.babylonjs.com/t/bug-in-createandstartanimation/55975/5 "2025-01-16T19:33:31Z")

</div>

![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/9/8/98670923f5c56c1b978189262db3a5a76010a896.jpeg)

😉
