# Strange camera behavior after camera animation

**URL:** <https://forum.babylonjs.com/t/strange-camera-behavior-after-camera-animation/56077>\
**Category:** Questions\
**Created:** [January 20, 2025, 4:52pm UTC](https://forum.babylonjs.com/t/strange-camera-behavior-after-camera-animation/56077 "2025-01-20T16:52:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![djeustice](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/djeustice/32/5517_2.png) [@djeustice](https://forum.babylonjs.com/u/djeustice)\
**Post date:** [January 20, 2025, 4:52pm UTC](https://forum.babylonjs.com/t/strange-camera-behavior-after-camera-animation/56077/1 "2025-01-20T16:52:08Z")

</div>

Hello,

Within the past 2 years, I’ve created 3 projects that utilize camera animation after clicking 3D objects or UI elements in the scene. They all were working great until recently.  
In the playground if you click the sphere, the camera is supposed to animate to the top view and stop. However, the camera continues weird movement after it reaches its defined location.

I am wondering, was there changes to the framework that may be causing this camera behavior? This functionality in my 3 projects was working fine up to a few weeks ago.  
Or am I missing a call to terminate the camera animation altogether?

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

Thank you,  
David

---

<div class="post-metadata">

**Author:** ![samuelgirardin](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/samuelgirardin/32/87_2.png) [@samuelgirardin](https://forum.babylonjs.com/u/samuelgirardin)\
**Post date:** [January 20, 2025, 6:09pm UTC](https://forum.babylonjs.com/t/strange-camera-behavior-after-camera-animation/56077/2 "2025-01-20T18:09:21Z")

</div>

Hi, my 2 cents , true, your code is working if you select bjs v 6.49 in the playground.

---

<div class="post-metadata">

**Author:** ![samuelgirardin](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/samuelgirardin/32/87_2.png) [@samuelgirardin](https://forum.babylonjs.com/u/samuelgirardin)\
**Post date:** [January 20, 2025, 6:32pm UTC](https://forum.babylonjs.com/t/strange-camera-behavior-after-camera-animation/56077/3 "2025-01-20T18:32:06Z")

</div>

@djeustice , this works [https://playground.babylonjs.com/?BabylonToolkit#0RDYGU#32](https://playground.babylonjs.com/?BabylonToolkit#0RDYGU#32) , I use 2 instead of 0 for loopmode. ‘2’ correspond to ANIMATIONLOOPMODE\_CONSTANT = 2;

---

<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:** [January 20, 2025, 8:05pm UTC](https://forum.babylonjs.com/t/strange-camera-behavior-after-camera-animation/56077/4 "2025-01-20T20:05:10Z")

</div>

This keeps popping on the forum and I am really afraid on the issue the change is creating ☹

Before using 0 or anything but 1 would not loop but 0 should be:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/2/e/2e2114796c4696f332527e95d33e8c383a6fef4b.png)

Basically for a couple year the animation would only loop for ANIMATIONLOOPMODE\_CYCLE which is wrong as we should loop for anything but ANIMATIONLOOPMODE\_CONSTANT

I fixed this a couple week back and it looks like it is breaking the code from a bunch a community members ☹ I ll try to think of something.

---

<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 20, 2025, 8:36pm UTC](https://forum.babylonjs.com/t/strange-camera-behavior-after-camera-animation/56077/5 "2025-01-20T20:36:08Z")

</div>

> [@sebavan](#):
>
> I ll try to think of something.

Idea:

```typescript
/** @deprecated Parameter "LoopModeThingy" should be used like so now... */
public static Anim.CreateAndStart(paramA, paramB, LoopModeThingy) {
   if(LoopModeThingy === likeItWasBeforeBreaking) {
     console.info("@deprecated parameter has changed. Please use enum. If you already use it please ignore this message. This info will be removed in x version increments.");
   }
}

```

#todo: Remove deprecation info after x verion increments.

---

<div class="post-metadata">

**Author:** ![djeustice](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/djeustice/32/5517_2.png) [@djeustice](https://forum.babylonjs.com/u/djeustice)\
**Post date:** [January 20, 2025, 9:15pm UTC](https://forum.babylonjs.com/t/strange-camera-behavior-after-camera-animation/56077/6 "2025-01-20T21:15:07Z")

</div>

@samuelgirardin Changing loopmode from 0 to 2 fixed the issue, thank you for the advice!

@sebavan I apologize for neglecting to search the forums deeper for a solution, I didn’t mean to repost the topic.

---

<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:** [January 20, 2025, 9:21pm UTC](https://forum.babylonjs.com/t/strange-camera-behavior-after-camera-animation/56077/7 "2025-01-20T21:21:32Z")

</div>

Nah, it is pretty good as it helps us maintainer figure how much we broke by actually fixing it 🙂
