How-To: Play a Camera Shake

Goal: play a camera shake (hit, explosion, footstep) on the local player's view.

Prerequisites
A UCameraShakeBase subclass (the standard engine shake asset) and a pawn with a UCrimsonCameraComponent.

Play the shake

Play Camera Shake forwards to the owning player's camera manager. It is a no-op for non-player pawns or a null shake, so it's safe to call from shared gameplay code.

From wherever the hit or explosion resolves: **Get Crimson Camera Component (drag the component in from My Blueprint -> Components) -> Play Camera Shake (`Shake` = your `UCameraShakeBase` subclass, `Scale` = `1.0`). If the shaking pawn is not the one you are in - an explosion actor shaking a nearby character, say - reach the component with Find Camera Component** (Actor = that pawn) first.

Verify
The local player's camera shakes; remote pawns' shakes are ignored (it only affects the player controlling that pawn).

See also

  • How-To: Expose Camera Options as User Settings - scale shake intensity from a player menu (Set Camera Shake Scale).