Rather than shaking the camera by a flat random amount, a common technique tracks a "trauma" value from 0 to 1 and makes shake intensity proportional to trauma squared. An impact raises trauma; every frame it decays by a fixed amount, and the current value drives the offset and rotation — harder hits shake harder, and it settles quickly as trauma drains.
Squaring matters because it keeps small hits nearly still while shake ramps up sharply as trauma accumulates — a linear curve leaves a constant low-level jitter that gets annoying. Building the offset from layered sine waves (or Perlin noise) instead of pure randomness makes the shake read as organic rather than jittery.
Shake the screen too hard or too often and UI text becomes unreadable, and it can trigger motion sickness. Capping the maximum offset, and clamping trauma at its ceiling (usually 1) so repeated hits don't stack forever, keeps it usable.
When to use
Reserve it for rare, high-impact moments — big hits, explosions, boss entrances. Shaking on every step or basic attack tires players out fast.