What are easing and lerp?
Lerp gets a value from A to B; easing makes the trip feel natural. Here is the formula, the curves worth knowing, and the common lerp mistake that varies by frame rate.

Key takeaways
- Lerp (linear interpolation) is a + (b - a) * t: the point a fraction t of the way from a to b.
- Easing curves reshape t so motion starts or ends gently: ease-out for things arriving, ease-in for things leaving.
- The popular "lerp a little toward the target each frame" trick depends on frame rate unless you scale it with delta time.
Lerp, short for linear interpolation, finds a value part of the way between two others, and easing is the curve that controls how quickly a movement or fade progresses from start to end. Together they are how games and interfaces move things smoothly instead of teleporting them.
Close a well-made drawer: it moves quickly at first and slows just before it shuts. A cheap one slams at full speed. Lerp gets the drawer from open to closed; easing is what makes it glide.
Lerp in one line
The formula is `lerp(a, b, t) = a + (b - a) * t`, with t from 0 to 1. lerp(100, 300, 0) is 100, lerp(100, 300, 0.5) is 200, lerp(100, 300, 1) is 300. It works for anything numeric: positions, colors, volume, zoom, the width of a health bar. To animate, you grow t from 0 to 1 over a duration: t = elapsed / duration.
Easing curves worth knowing
Easing replaces t with a curved version before the lerp. A handful cover most needs:
- Linear: constant speed. Feels mechanical; fine for progress bars and scrolling backgrounds.
- Ease-out (fast, then slow, for example 1 - (1 - t)^3): things arriving. Menus sliding in, coins flying to the counter, a camera settling.
- Ease-in (slow, then fast): things leaving or falling away.
- Ease-in-out: gentle at both ends, for travel from one rest to another, like a level map panning between nodes.
- Back and elastic: overshoot then settle. A button that pops to 110% then back to 100% feels alive; use it sparingly.
Durations matter as much as curves. Starting values: 150 to 250 ms for UI responses, 300 to 500 ms for screen transitions (scene transitions), under 100 ms for hit reactions. Slower than that and the game feels sluggish.
The frame-rate trap
A very common shortcut is `x = lerp(x, target, 0.1)` every frame: move 10% of the remaining gap, giving a nice ease-out for cameras and followers. The catch is that it runs twice as often at 120 fps, so the camera catches up much faster on a fast screen. The fix uses delta time: `x = lerp(x, target, 1 - Math.pow(0.001, dt))` closes 99.9% of the gap per second whatever the frame rate. If a camera feels tighter on one device than another, this is usually why (game camera guide).
Easing when building with Startbase
Easing is most of what people mean by "polish" and "juice" (game feel and juice). The useful way to ask for it is by moment and feeling: what moves, how long, and whether it should overshoot. Make the key durations Engine panel dials in a game so you can feel 200 ms versus 300 ms instead of debating it.
Make motion feel smooth: health bars ease down over 300 ms with a white trailing bar, collected coins fly to the counter with ease-out in 400 ms, buttons pop to 108% and back in 150 ms, and the camera follows using frame-rate-independent smoothing. Expose the camera smoothing as a dial.
Common confusions
- Tween vs lerp. A tween is a ready-made animation (from, to, duration, easing); lerp is the math inside it.
- Easing vs physics. Easing follows a fixed curve and always lands on time. Springs and physics respond to forces and may land at different times.
- Slerp. Spherical lerp, for rotations in 3D, so turning takes the short way around.
Frequently asked questions
What does lerp stand for?
Linear interpolation: finding the value a given fraction of the way between two values, a + (b - a) * t.
Which easing should I use for UI?
Ease-out for things appearing or arriving, ease-in for things leaving, about 150 to 250 ms. Linear motion tends to look robotic.
Why does my lerp camera behave differently on different screens?
A fixed lerp fraction per frame runs more often at higher frame rates. Base the fraction on delta time so it is the same per second.

