Screen shake
Shake the camera to sell impacts, without making people sick.
A small camera shake on big hits and explosions adds punch nothing else can. Done badly, with random jumps every frame that stop abruptly, it looks like a glitch. Good shake uses a "trauma" value that each impact raises and that decays smoothly, with the shake strength rising as trauma squared, and smooth noise instead of pure randomness.
Try this: Spam small hits in Random mode, then in Smooth mode. Small hits barely shake on Smooth; big ones still land hard.
Hit the slime.
Prompt bit
Works for 2D or 3D in any engine (Unity, Unreal, Godot, web). Paste the short one for a quick fix, or the detailed one when you want it done properly.
Add trauma-based screen shake: each impact adds 0.2 to 1 trauma (capped at 1), trauma decays to zero within about 0.7 s, offset and tilt use trauma squared times smooth noise, and offer an accessibility setting to reduce or disable it.
Implement screen shake with a trauma value (2D or 3D, any engine). Keep trauma in 0..1: small hits add 0.2, big hits 0.5, explosions 0.8 to 1, clamped at 1; it decays linearly by 1.5 per second. Each frame compute shake = trauma * trauma, then offset the camera by maxOffset * shake * noise(seed, time * frequency) per axis (default maxOffset 0.3 units in 3D or 12 px in 2D, frequency about 25) and roll by maxAngle * shake * noise (default 3 degrees; in 3D first-person prefer small rotations over position changes). Use smooth noise (Perlin or summed sines) with a different seed per axis, not random values every frame. Apply shake to a child offset of the camera so it never accumulates or fights the follow logic. Scale trauma by distance for explosions. Use unscaled time if the game uses hit stop or slow motion so the shake keeps going. Add a settings slider (0 to 100%) and respect reduced-motion preferences. Expose all values.
Where it's used
- Action games and brawlers: heavy hits, finishers and boss slams
- Shooters: explosions, weapon recoil and damage taken
- Platformers: ground pounds and big landings
- Racing games: crashes and off-road rumble
- Horror and cinematics: earthquakes and nearby impacts
Common mistakes
A new random offset every frame (looks like a glitch), moving the main camera position so the shake accumulates and drifts, shaking on every small event until players feel sick, and no option to turn it off.
Writing this with an AI assistant? See our best AI coding assistants for game developers.
Missing a concept? Request one.



