Jittery game physics and how to smooth it
Jitter is rarely the physics engine being bad. It is physics and rendering running on different clocks, and the camera showing the mismatch.

Key takeaways
- Most jitter comes from physics stepping at a fixed rate while the screen refreshes at another, with no interpolation between steps.
- A camera that follows the physics body directly, or updates before physics, makes the whole world shake.
- Bodies resting on each other vibrate when they are tiny, very light next to very heavy, or teleported every frame.
- Test on a 120 Hz phone and a 60 Hz laptop: jitter that only shows on one is a timing bug.
Jittery game physics, where a player or object stutters, shakes or moves in uneven steps instead of gliding, is most often a timing mismatch: physics advances in fixed steps (say 60 per second) while the screen draws at a different rate (120 Hz on many phones, or an uneven rate when the browser is busy), and the game draws the raw physics position without blending between steps. Some frames show two steps of movement and some show none. The camera usually makes it worse by following that uneven position. The fix is a fixed timestep with interpolation, and a camera that follows the smoothed position.
Name the jitter first
Different shakes have different causes. Watch for ten seconds and decide which you have.
- The moving player stutters, but the background looks fine when still: timestep without interpolation (cause 1).
- The whole world shakes while the player looks steady: the camera follows a jittery target (cause 2).
- Smooth on your laptop, stuttery on a phone, or the other way round: frame rate dependence (cause 3).
- Objects at rest vibrate or buzz on the ground or on each other: solver and scale issues (cause 4).
- A body twitches or snaps back when you move it: code fighting the physics engine (cause 5).
- Smooth, then a big hitch every few seconds: a performance spike, not physics. See game slows down over time.
Causes, most likely first
1. Fixed physics steps drawn without interpolation
Physics engines are stable when they step by the same amount every time, typically 1/60 of a second. The usual loop keeps an accumulator: add the real time since the last frame, run as many fixed steps as fit, carry the remainder. On a 120 Hz screen, half the frames run zero steps and half run one, so the object moves, stops, moves, stops. On an uneven 50 to 60 fps, some frames run two steps.
Check: log how many physics steps run per rendered frame. A pattern like 1, 0, 1, 0 or 1, 1, 2, 1 confirms it. Fix: interpolate. Keep each body's previous and current position, and draw at previous + (current - previous) * alpha, where alpha is the leftover accumulator divided by the step size. Rotation gets the same blend (slerp for 3D quaternions). This adds at most one step of visual delay, about 17 milliseconds, which nobody feels. The delta time glossary entry explains the accumulator in more detail.
2. The camera follows the raw physics position
If the camera copies the player's physics position each frame, any unevenness in that position is applied to the entire screen. Worse, if the camera updates before the physics step in the frame, it is always one step behind and alternates between catching up and overshooting. Fix: update the camera last, after physics and interpolation, and follow the interpolated position. Add gentle smoothing (move a fraction of the distance each frame, using delta time so it behaves the same at 60 and 120 Hz) and a small dead zone so tiny movements do not move the view. Game camera guide covers follow styles.
3. Movement tied to frame rate
Code that moves something by a fixed amount every frame (x += 5) runs twice as fast on a 120 Hz screen, and any mix of that with physics-driven motion causes visible drift and stutter between objects. Check: compare speed on two devices with different refresh rates, or throttle the CPU in developer tools. Fix: move everything either through physics steps or with delta time, never per frame. Also clamp delta time (for example to a quarter of a second) so returning from a background tab does not run hundreds of steps at once.
4. Bodies resting on each other buzz
Stacks and resting objects vibrate when the solver cannot settle them. Common reasons: objects far smaller or larger than the engine expects (physics engines like units around a meter, so a 0.01 unit coin or a 1000 unit crate both misbehave), a mass ratio above roughly 10 to 1 between touching bodies, too few solver iterations, or collider shapes that overlap at the start. Fix: scale the world so typical objects are 0.5 to 5 units, keep mass ratios moderate, let bodies sleep when still, and start objects slightly apart. If the game uses its own collision code rather than an engine, resolve overlap by pushing out along the shortest axis and zeroing velocity into the surface; never leave a body slightly inside the floor.
5. Code that teleports physics bodies
Setting the position of a dynamic body every frame (for example to follow the mouse, or to snap it to a grid) fights the engine: physics moves it, your code moves it back, and it twitches. Fix: move dynamic bodies with velocities or forces, use kinematic bodies for things you control directly (moving platforms, doors), and only set positions for teleports, then reset velocity.
6. Sub-pixel shimmer in 2D pixel art
In pixel-art games, sprites at fractional positions shimmer as the renderer samples them between pixels. Fix: keep physics in exact positions, but round the drawn position (and the camera) to whole pixels at the end of the frame. Round both, or the player and the world shimmer against each other.
In a Startbase game
Startbase 2D games run on PixiJS and 3D games run on Three.js, with Rapier physics ready to switch on (games template). Rapier steps at a fixed rate you choose, so the interpolation advice applies directly. In 2D games, movement is often custom code rather than an engine, which makes causes 3 and 6 more likely. The agent playtests its builds in a real browser for a few seconds, which catches errors and broken screens; smoothness is something you judge on your own phone, so test there.
The message to send the agent
The player ball stutters while rolling, and on my 120 Hz phone the whole level shakes when the camera follows it. Run physics on a fixed 1/60 s step with an accumulator, clamp frame delta to 0.25 s, and draw every dynamic body at an interpolated position and rotation between its last two steps. Update the camera after physics, following the interpolated position with delta-time smoothing and a small dead zone. Replace any per-frame movement with delta time, and stop setting positions on dynamic bodies except for respawns. Keep the game's feel and speeds the same.
If the game used to be smooth, open Versions and preview earlier builds to find where it changed; a diff of that turn often shows the exact line (versions docs).
How to know it is fixed
- 01Move the player at constant speed past a striped background. Stripes should glide, not tick.
- 02Test on a 120 Hz phone and a 60 Hz screen. Speed and smoothness should match.
- 03Leave a stack of objects at rest for 30 seconds. Nothing should buzz or creep.
- 04Switch to another tab for a minute and come back. The game should resume without objects flying off.
Frequently asked questions
Why does my game stutter on a 120 Hz phone but not on my laptop?
Physics likely steps 60 times a second while the phone draws 120 frames, so every other frame shows no movement. Interpolate drawn positions between physics steps.
Should I just run physics every frame with the frame's delta time?
It removes the step mismatch, but variable steps make collisions and jumps inconsistent between devices. A fixed step with interpolation gives stable physics and smooth motion.
Why do my objects vibrate when resting on the ground?
Usually the scale is far from what the engine expects, mass ratios are extreme, or objects start overlapping. Keep objects around 0.5 to 5 units, use moderate masses, and let resting bodies sleep.
Why does the camera make my game look shaky?
It follows a position that moves unevenly, or it updates before physics. Update it last and follow the interpolated position with light smoothing.

