CameraEffectSystemclass

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.

objectGameObjectSystem<T>CameraEffectSystem
Namespace
Sandbox
Assembly
Sandbox.Engine
Declaration
public sealed class Sandbox.CameraEffectSystem : Sandbox.GameObjectSystem<T>

Constructors1

Showing 1 constructors

Methods8

Showing 8 methods

public T Add(T effect)PUBLIC

Add a camera effect. A null `Sandbox.CameraEffectSystem.BaseEffect.Camera` applies to every camera.

ParameterTypeDescription
effectT
Returns:T

public void Clear()PUBLIC

Remove every active effect.

Returns:void

public void QueryOffsets(Sandbox.CameraComponent camera, Vector3 position, Angles angles, float fieldOfView)PUBLIC

The combined effect offsets for this camera this frame - the position is camera-local (`Vector3.Forward` pushes the view forward). The camera reads these once per tick, when it composes its view.

ParameterTypeDescription
cameraCameraComponent
positionVector3
anglesAngles
fieldOfViewfloat
Returns:void

Properties1

Showing 1 properties

public float Sandbox.CameraEffectSystem.Scale { get; set; }PUBLICGETSET

Global multiplier on every camera effect - wire this to a screen shake preference. Zero disables them entirely.

Returns:float

On this page