# Easing Lerp for animation

**URL:** <https://forum.babylonjs.com/t/easing-lerp-for-animation/41296>\
**Category:** Questions\
**Tags:** animation\
**Created:** [June 1, 2023, 8:52am UTC](https://forum.babylonjs.com/t/easing-lerp-for-animation/41296 "2023-06-01T08:52:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![WillemCramer](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/willemcramer/32/11696_2.png) [@WillemCramer](https://forum.babylonjs.com/u/WillemCramer)\
**Post date:** [June 1, 2023, 8:52am UTC](https://forum.babylonjs.com/t/easing-lerp-for-animation/41296/1 "2023-06-01T08:52:37Z")

</div>

I have made this zLerp function to try and smoothen out an animation here:

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

the original is the too - oLerp. but i would like to get rid of the pumping, breathing like effect.  
Any ideas?

---

<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:** [June 1, 2023, 5:35pm UTC](https://forum.babylonjs.com/t/easing-lerp-for-animation/41296/2 "2023-06-01T17:35:53Z")

</div>

Have you tried the built-in ease functions?

> **[Advanced Animation Methods | Babylon.js Documentation](https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#easing-functions)**
>
> Dive into some deeper animation methods and techniques.

For eg, using the bezier curve ease function:

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

---

<div class="post-metadata">

**Author:** ![WillemCramer](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/willemcramer/32/11696_2.png) [@WillemCramer](https://forum.babylonjs.com/u/WillemCramer)\
**Post date:** [June 2, 2023, 11:51am UTC](https://forum.babylonjs.com/t/easing-lerp-for-animation/41296/4 "2023-06-02T11:51:30Z")

</div>

Thanks !  
been able to implement it like this:

```auto
const ease = new BABYLON.BezierCurveEase(.65,.39,.26,.54);
    function zLerp(start, end, value) {
        var tMod = ease.easeInCore(value);
        var result = start + (end - start) * tMod;
        return result;
    }

```

Thanks @Evgeni_Popov !  
(numbers taken from [https://cubic-bezier.com/](https://cubic-bezier.com/))

see it at work:

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