API Reference › Camera › Camera.shake_for
method

Camera.shake_for

Camera.shake_for(amount: px, frames: n)

Shakes the camera by up to ±amount pixels for frames frames; the engine re-rolls the offset each frame and clears it when the time is up. A bigger amount replaces one in flight. Camera.shake(amount: 0) still cancels the offset for the rest of a frame — useful before a HUD pass that must stay steady.

Example

# doc-check: skip — illustrative
@On(Damaged) handler Hurt { if target == player { Camera.shake_for(amount: 4, frames: 8) } }
← All symbols