Easing curves
An ease shapes the speed of an animation over its duration. Every curve below is in both Lite and Pro, under Ease.
panel.Animate().MoveY(0f, 0.4f).From(24f).Ease(Ease.OutCubic);
Which one to use
- Entrances:
OutCubic(the default) orOutQuart. Fast start, soft landing. - Exits:
InCubic. Accelerating away reads as "gone". - Moving between two places on screen:
InOutCubic. - Pop-ins and dialogs:
OutBackfor a small overshoot (or a spring in Pro). - Loops and pulses:
InOutSinewithLoopMode.PingPong. - Progress and spinners:
Linear.
All curves
The two lines mark the start and end values. Curves that cross them overshoot.
Ease.LinearConstant speed. Mechanical; use for progress bars and spinners.Ease.InSineEase.OutSineEase.InOutSineGentle both ends. Good for looping pulses.Ease.InQuadEase.OutQuadEase.InOutQuadEase.InCubicAccelerates away. Good for exits.Ease.OutCubicFast start, soft landing. The default for entrances.Ease.InOutCubicFor moves between two resting places.Ease.InQuartEase.OutQuartEase.InOutQuartEase.InExpoEase.OutExpoVery fast start, long settle.Ease.InOutExpoEase.InCircEase.OutCircEase.InOutCircEase.InBackPulls back before leaving.Ease.OutBackOvershoots slightly, then settles. Dialogs and pop-ins.Ease.InOutBackEase.InElasticEase.OutElasticWobbles into place. Playful rewards.Ease.InOutElasticEase.InBounceEase.OutBounceLands and bounces. A drop or a falling badge.Ease.InOutBounceYour own curve
Draw a curve in the inspector and use it as an ease:
[SerializeField] AnimationCurve curve = AnimationCurve.EaseInOut(0, 0, 1, 1);
badge.Animate().ScaleTo(1.2f, 0.5f).Ease(Ease.FromCurve(curve));
The curve is sampled from time 0 to 1. Values above 1 or below 0 overshoot.
Easing in the inspector and JSON
Presets and JSON sequences name the ease as text ("ease": "OutBack"). They accept this subset: Linear, InSine, OutSine, InOutSine, InQuad, OutQuad, InOutQuad, InCubic, OutCubic, InOutCubic, OutQuart, OutExpo, OutCirc, InBack, OutBack, InOutBack, OutElastic, OutBounce. Code can use all of the curves above.