Frame rate independent smoothing for Unity. Exponential smoothing, spring dampers, 30+ easing curves and an editor window that shows how it all works.
Use cases: camera systems, UI motion, network..DAWG Tools - Smooth PROMost Unity projects have code like this:current = Mathf.Lerp(current, target, 0.1f);It runs every frame, applying a fixed percentage step toward the target. At 30 FPS it applies 30 times per second. At 144 FPS it applies 144 times per second. Players on faster machines see faster smoothing.The fix is one line:current = Smooth.Exp(current, target, 10f, Time.deltaTime);Same behavior at every frame rate. The math uses exp(-speed * dt) which naturally compensates for variable frame times.Use cases: camera systems, UI motion and transitions, gameplay parameter smoothing, audio interpolation, network / multiplayer interpolation.WHAT'S INCLUDEDExponential Smoothing (Smooth class)- Smooth.Exp — frame-rate independent exponential smoothing- Smooth.ExpHalfLife — parameterized by half-life (designer-friendly: "halfway to target in 0.2 seconds")- Smooth.ExpAngle — wrap-safe angle smoothing (no snapping at 0/360)- Overloads for float, Vector2, Vector3, Quaternion, ColorSpring Dampers (Spring class)- Spring.Critical — fastest convergence, no overshoot- Spring.Damped — general-purpose, any damping ratio- Spring.Bouncy — configurable overshoot and oscillation- Overloads for float, Vector2, Vector3- Adaptive substepping for frame-rate stable resultsEasing Functions (Ease class)- 30+ standard curves: Quad, Cubic, Quart, Quint, Sine, Expo, Circ, Back, Elastic, Bounce- In / Out / InOut variants for each- SmoothStep and SmootherStep (Hermite / Perlin)- Ease.Lerp helper combining easing + interpolationConversion Utilities- SpeedFromBrokenLerpT — convert existing lerp t values to correct speed- SpeedFromHalfLife / HalfLifeFromSpeed- ConvergenceTime — time to reach 90%, 99%, etc.Editor Window (Window > DAWG Tools > Smooth Inspector)- Three modes: Exponential, Spring, Ease- Exponential: side-by-side graph of naive lerp vs Smooth.Exp at different frame rates- Spring: response curve visualization showing overshoot for bouncy settings- Ease: curve shape preview for all easing functions- dt profile stress test (constant FPS, jittered frame times, FixedUpdate simulation, custom tick rates)- Convergence analysis, migration helper, copy-to-clipboard snippetsEXAMPLESCamera follow:// Before (frame-rate dependent)transform.position = Vector3.Lerp(transform.position,target.position,followSpeed * Time.deltaTime);// After (consistent at any FPS)transform.position = Smooth.ExpHalfLife(transform.position, target.position,0.15f, Time.deltaTime);UI fade (works during frame drops and with timescale = 0):canvasGroup.alpha = Smooth.ExpHalfLife(canvasGroup.alpha, targetAlpha,0.08f, Time.unscaledDeltaTime);Rotation (no snapping at 0/360 boundary):currentYaw = Smooth.ExpAngle(currentYaw, targetYaw,Smooth.SpeedFromHalfLife(0.12f),Time.deltaTime);Spring motion:position = Spring.Critical(position, target,ref velocity, 5f,Time.deltaTime);Easing:float t = elapsed / duration;float eased = Ease.OutCubic(t);value = Mathf.LerpUnclamped(start, end, eased);- Unity 2021.3 LTS or newer- Built-in, URP, and HDRP compatible- Separate Runtime and Editor assemblies- Zero runtime allocations- No third-party dependencies- IL2CPP and Mono compatible- Namespace: DawgTools.SmoothQUICK STARTusing DawgTools.Smooth;using UnityEngine;public class SmoothExample : MonoBehaviour{ public float halfLife = 0.12f; float _value; void Update() { float target = Mathf.Sin(Time.time) * 10f; _value = Smooth.ExpHalfLife( _value, target, halfLife, Time.deltaTime); }}LICENSELicensed under Unity Asset Store EULA.This asset was developed with AI-assisted tools used during development (code review, refactoring suggestions, and documentation drafting).All algorithms, architecture decisions, and final code were reviewed, validated, and are fully owned by the publisher.The asset does not require any AI services at runtime and contains no AI-generated media or external dependencies.



