← All packages

Smooth Pro

Frame-rate independent smoothing for Unity. The drop-in fix for the most common Unity mistake: using Lerp(value, target, 0.1f) every frame.

v1.1.0 Unity 2021.3+ No dependencies namespace: DawgTools.Smooth

The problem

Broken (frame-rate dependent)

// This runs every frame with a fixed 10% step.
// At 30fps: 30 steps/sec. At 144fps: 144 steps/sec.
// Players on faster machines see faster smoothing.
value = Mathf.Lerp(value, target, 0.1f);

Fixed (frame-rate independent)

// Same behavior at any frame rate.
// Uses exp(-speed * dt) which naturally
// compensates for variable frame times.
value = Smooth.Exp(value, target, 10f, Time.deltaTime);

Quick start

using DawgTools.Smooth;

// --- Exponential smoothing ---

// Direct replacement for broken Lerp
transform.position = Smooth.Exp(transform.position, target, 10f, Time.deltaTime);

// Designer-friendly: "halfway to target in 0.2 seconds"
value = Smooth.ExpHalfLife(value, target, 0.2f, Time.deltaTime);

// Angle-aware (handles 0/360 wrap correctly)
angle = Smooth.ExpAngle(angle, targetAngle, 8f, Time.deltaTime);

// --- Spring dampers ---

// Critically damped: fastest convergence, no overshoot
pos = Spring.Critical(pos, target, ref velocity, 5f, Time.deltaTime);

// Bouncy: overshoots and oscillates
scale = Spring.Bouncy(scale, targetScale, ref scaleVel, 8f, 0.5f, Time.deltaTime);

// --- Migration ---

// Convert your existing broken lerp value to correct speed
float speed = Smooth.SpeedFromBrokenLerpT(0.1f, 60f); // ~6.32

// --- Easing ---

float t = Ease.InOutCubic(progress);
value = Ease.Lerp(start, end, progress, EaseType.InOutElastic);

Exponential smoothing - Smooth

Static class. All methods overloaded for float, Vector2, Vector3, Quaternion, and Color.

MethodDescription
Smooth.Exp(value, target, speed, dt)Exponential smoothing using exp(-speed * dt). The core fix.
Smooth.ExpHalfLife(value, target, halfLife, dt)Same math, parameterized by half-life in seconds. Designer-friendly.
Smooth.ExpAngle(value, target, speed, dt)Angle-aware version. Handles 0/360 wrap correctly.
Smooth.SpeedFromBrokenLerpT(t, fps)Convert existing broken lerp t-value to correct speed at a reference fps.
Smooth.ConvergenceTime(speed, pct)How long to reach a given percentage (default 99%) convergence.

Spring dampers - Spring

Second-order spring dynamics with adaptive substepping for frame-rate stability. Overloaded for float, Vector2, Vector3.

MethodDescription
Spring.Critical(val, target, ref vel, freq, dt)Critically damped. Fastest convergence without overshoot.
Spring.Bouncy(val, target, ref vel, freq, bounciness, dt)Elastic/springy feel with configurable bounciness (0-1).
Spring.Damped(val, target, ref vel, freq, damping, dt)General second-order spring with arbitrary damping ratio.

Easing functions - Ease

30+ standard curves. Each available as In, Out, and InOut variants.

FamilyCurves
PolynomialQuad, Cubic, Quart, Quint
TrigonometricSine
ExponentialExpo, Circ
OvershootBack, Elastic, Bounce
HermiteSmoothStep, SmootherStep (Perlin variant)

Ease.Lerp(start, end, t, EaseType) combines easing + interpolation in one call.

Editor tools

Window > DAWG Tools > Smooth Inspector

  • Exponential mode - Side-by-side graph comparing naive Lerp vs Smooth.Exp at 30/60/144fps. See the frame-rate dependency visually.
  • Spring mode - Response curve visualization showing overshoot, settling time, and ringing for bouncy settings.
  • Ease mode - Curve shape preview for all 30+ easing functions.
  • dt stress test - Test your smoothing under constant FPS, jittered frames, FixedUpdate, and custom tick rates.
  • Migration helper - Converts your existing broken lerp values to correct exponential speeds. Copy-paste ready code.

Installation

// Unity Package Manager > Add package from disk
// Navigate to package.json and select it

// Then import the demo scene:
// Package Manager > Motion Smoothing Pro > Samples > Import

Requires Unity 2021.3 LTS or newer. No external dependencies.