# Rotate around pivot animation

**URL:** <https://forum.babylonjs.com/t/rotate-around-pivot-animation/47922>\
**Category:** Questions\
**Tags:** animation, pivot, animationgroups, rotation\
**Created:** [February 8, 2024, 12:59pm UTC](https://forum.babylonjs.com/t/rotate-around-pivot-animation/47922 "2024-02-08T12:59:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![MeshSlayer](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@MeshSlayer](https://forum.babylonjs.com/u/MeshSlayer)\
**Post date:** [February 8, 2024, 12:59pm UTC](https://forum.babylonjs.com/t/rotate-around-pivot-animation/47922/1 "2024-02-08T12:59:10Z")

</div>

Hello community,

I’m trying to create an animation to rotate an object around a specific object, I was heavily inspired by [the script](https://doc.babylonjs.com/toolsAndResources/utilities/Pivot#rotate) I found in the docs

as i was able to rotate around a specific point, the animation was not smooth, since it’s a rotationQuaternion and a position animation at same time.

is there anyway I can modify my script so I can create a smoother animation ? (as if the object pivot was the given point)

here’s my playground, would appreciate the help

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

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [February 8, 2024, 1:25pm UTC](https://forum.babylonjs.com/t/rotate-around-pivot-animation/47922/2 "2024-02-08T13:25:53Z")

</div>

What do you mean by ‘not smooth’? I’ve ran the PG multiple time sand everything seems smooth to me. let me know what I’m missing here 🙂

---

<div class="post-metadata">

**Author:** ![MeshSlayer](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@MeshSlayer](https://forum.babylonjs.com/u/MeshSlayer)\
**Post date:** [February 8, 2024, 2:07pm UTC](https://forum.babylonjs.com/t/rotate-around-pivot-animation/47922/3 "2024-02-08T14:07:05Z")

</div>

oh sorry for the confusion,  
imagine if the box pivot was actually the red sphere, if we were to rotate it on it forward vector it would perform a pendulum swing animation,

maybe one of the solution is to compute the new position/rotation and set keyframes values at “each frame”, but I think that’s could an overkill for a simple animation. 😅

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [February 8, 2024, 2:18pm UTC](https://forum.babylonjs.com/t/rotate-around-pivot-animation/47922/4 "2024-02-08T14:18:21Z")

</div>

I think I understand: you want the movement to decelerate/accelerate back around the apex?  
Did you try this?

> **[ACE - The Animation Curve Editor | Babylon.js Documentation](https://doc.babylonjs.com/toolsAndResources/inspector/animationCurveEditor)**
>
> Learn all about the powerful Animation Curve Editor.

---

<div class="post-metadata">

**Author:** ![MeshSlayer](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@MeshSlayer](https://forum.babylonjs.com/u/MeshSlayer)\
**Post date:** [February 8, 2024, 2:26pm UTC](https://forum.babylonjs.com/t/rotate-around-pivot-animation/47922/5 "2024-02-08T14:26:50Z")

</div>

not really,  
I want to achieve this animation, without having to set a new pivot point to the box

here’s a playground where the sphere is the box pivot

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

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [February 8, 2024, 2:30pm UTC](https://forum.babylonjs.com/t/rotate-around-pivot-animation/47922/6 "2024-02-08T14:30:24Z")

</div>

You need more keys in your animation or tweak curve tangent with ACE.  
Or go procedural 🙂
