# Issue with relative animation

**URL:** <https://forum.babylonjs.com/t/issue-with-relative-animation/46042>\
**Category:** Bugs\
**Created:** [November 29, 2023, 4:24pm UTC](https://forum.babylonjs.com/t/issue-with-relative-animation/46042 "2023-11-29T16:24:32Z")\
**Posts on this page:** 7\
**Page:** 1

<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:** [November 29, 2023, 4:24pm UTC](https://forum.babylonjs.com/t/issue-with-relative-animation/46042/1 "2023-11-29T16:24:32Z")

</div>

Hi!

This PG runs a relative animation. It should start to animate the position of sphere from the current position. Looped animation sequences are started correctly, relative to the spehere’s position.

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

Thank you!

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [November 29, 2023, 8:22pm UTC](https://forum.babylonjs.com/t/issue-with-relative-animation/46042/2 "2023-11-29T20:22:45Z")

</div>

I think relative mode repeats from the start key, not from the current value, but I might be mistaken, so I’ll tag @sebavan to check 🙂

---

<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:** [November 29, 2023, 9:09pm UTC](https://forum.babylonjs.com/t/issue-with-relative-animation/46042/3 "2023-11-29T21:09:12Z")

</div>

> [@carolhmj](#):
>
> relative

@Evgeni_Popov is the best with animations 🙂

---

<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:** [November 30, 2023, 4:07am UTC](https://forum.babylonjs.com/t/issue-with-relative-animation/46042/4 "2023-11-30T04:07:06Z")

</div>

> [@carolhmj](#):
>
> relative mode repeats from the start key, not from the current value

It should start from the current value in my opinion. Then it will be really relative 🙂

However the same effect can be achieved by parenting the animated mesh and move the parent to the desired starting position but the simpler the better.

> **[Babylon.js Playground](https://playground.babylonjs.com/#SK7C9Y%234)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

---

<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:** [November 30, 2023, 9:56am UTC](https://forum.babylonjs.com/t/issue-with-relative-animation/46042/5 "2023-11-30T09:56:28Z")

</div>

I agree that it would be better if relative mode started from the object’s current value, but if we change it, it will be a breaking change… We could consider it more of a bug, but the existing relative animations would still be broken…

I’ve created a PR anyway, so let’s see if we can merge it:

> <https://github.com/BabylonJS/Babylon.js/pull/14563>
>
> See https://forum.babylonjs.com/t/issue-with-relative-animation/46042/4
> 
> I don…'t know if we should make the change (there's a workaround, see the thread), as it is a breaking change (except if we consider it to be a bug, but it will still break existing animations that use the relative loop mode)...
> 
> PG to test: https://playground.babylonjs.com/#SK7C9Y#7
> 
> Animations should start from the starting position, but this is not the case.

---

<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:** [November 30, 2023, 12:36pm UTC](https://forum.babylonjs.com/t/issue-with-relative-animation/46042/6 "2023-11-30T12:36:12Z")

</div>

> [@Evgeni\_Popov](#):
>
> but the existing relative animations would still be broken…

What about to introduce another relative mode? RELATIVE\_FROM\_CURRENT let’s say…

thank you!

---

<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:** [November 30, 2023, 12:48pm UTC](https://forum.babylonjs.com/t/issue-with-relative-animation/46042/7 "2023-11-30T12:48:48Z")

</div>

I reported your idea on my PR, so let’s see what the team thinks.
