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.
Constructors1
Showing 1 constructors
public CameraEffectSystem(Sandbox.Scene scene)
| Parameter | Type | Description |
|---|---|---|
| scene | Scene | — |
No results match this filter.
Methods8
Showing 8 methods
public T Add(T effect)
Add a camera effect. A null `Sandbox.CameraEffectSystem.BaseEffect.Camera` applies to every camera.
| Parameter | Type | Description |
|---|---|---|
| effect | T | — |
T—public Sandbox.CameraEffectSystem.BaseEffect AddTilt(Sandbox.CameraComponent camera, Angles angle, float duration, float easeTime = 0.2)
Tilt the camera by `angle`, eased in over `easeTime` and back out before `duration` ends.
| Parameter | Type | Description |
|---|---|---|
| camera | CameraComponent | — |
| angle | Angles | — |
| duration | float | — |
| easeTime = 0.2 | float | — |
public void Clear()
Remove every active effect.
void—public void QueryOffsets(Sandbox.CameraComponent camera, Vector3 position, Angles angles, float fieldOfView)
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.
| Parameter | Type | Description |
|---|---|---|
| camera | CameraComponent | — |
| position | Vector3 | — |
| angles | Angles | — |
| fieldOfView | float | — |
void—No results match this filter.
Properties1
Showing 1 properties
public float Sandbox.CameraEffectSystem.Scale { get; set; }
Global multiplier on every camera effect - wire this to a screen shake preference. Zero disables them entirely.
float—No results match this filter.