# Sandbox.CameraEffectSystem

Transient camera effects - screen shakes, punches and tilts. Fire and forget:
`CameraEffectSystem.Current.AddShake( Scene.Camera, 4, 40, 1 )`. The camera folds the
combined offsets in when it composes its view each tick - effects never touch the camera's
transform or the player's aim, so they can't accumulate or fight the game's camera code.

- Kind: class
- Namespace: `Sandbox`
- Assembly: `Sandbox.Engine`
- Inherits: [Sandbox.GameObjectSystem<T>](/api/Sandbox.GameObjectSystem<T>)
- Modifiers: sealed

## Constructors

- [`CameraEffectSystem`](/api/Sandbox.CameraEffectSystem/.ctor)

## Properties

- [`Scale`](/api/Sandbox.CameraEffectSystem/Scale): Global multiplier on every camera effect - wire this to a screen shake preference. Zero disables them entirely.

## Methods

- [`Add`](/api/Sandbox.CameraEffectSystem/Add): Add a camera effect. A null [Sandbox.CameraEffectSystem.BaseEffect.Camera](/api/Sandbox.CameraEffectSystem.BaseEffect/Camera) applies to every camera.
- [`AddPunch`](/api/Sandbox.CameraEffectSystem/AddPunch): A punch along a camera-local direction that oscillates and dies out - [Vector3.Up](/api/Vector3/Up) bounces the view upward, `frequency` scales how often it oscillates before it lapses.
- [`AddShake`](/api/Sandbox.CameraEffectSystem/AddShake): The classic screen shake (Half-Life's env_shake) - every 1/`frequency` seconds a new random offset within `amplitude` world units, settling to nothing over `duration`. A duration of zero shakes until [Sandbox.CameraEffectSystem.BaseEffect.Stop](/api/Sandbox.CameraEffectSystem.BaseEffect/Stop).
- [`AddTilt`](/api/Sandbox.CameraEffectSystem/AddTilt): Tilt the camera by `angle`, eased in over `easeTime` and back out before `duration` ends.
- [`Clear`](/api/Sandbox.CameraEffectSystem/Clear): Remove every active effect.
- [`QueryOffsets`](/api/Sandbox.CameraEffectSystem/QueryOffsets): The combined effect offsets for this camera this frame - the position is camera-local ([Vector3.Forward](/api/Vector3/Forward) pushes the view forward). The camera reads these once per tick, when it composes its view.
