Easing Animations

Any animation method will accept an animation curve. Creating animation curves in the usual way can be quite the task (especially with scripting). Which is why Animatables comes with 42 easing curves that are available to you at any time.

Just call the static Ease class and pick an easing option.

For example, here's how we could create a looping elastic move animation for a RectTransform:

private void Start()
{
    var rect = GetComponent<RectTransform>();
    
    // Since this is a RectTransform, the anchoredPosition3D is being used instead of position
    // Animate from (0, 0, 0) to (0, 600, 0) in 1 second with elastic easing (looped)
    rect.Move(Vector3.zero, new Vector3(0, 600, 0), 1, Ease.InOutElastic, 0, true);
}

Last updated