Skip to content
Bartholomew Ho edited this page Nov 9, 2026 · 1 revision

Camera

The game's camera. Right now you can use it to shake the camera.

Thread: any.

Example

Shake the camera while you go faster than 300 km/h.

protected override void OnInit()
{
    Game.Tick += () =>
    {
        var fast = Player.Car is { } car && car.SpeedKmh > 300;
        Camera.Shake = fast ? 1f : 0f;
    };
}
Protected Overrides Sub OnInit()
    AddHandler Game.Tick, Sub()
                              Dim car = Player.Car
                              Dim fast = car IsNot Nothing AndAlso car.SpeedKmh > 300
                              Camera.Shake = If(fast, 1.0F, 0.0F)
                          End Sub
End Sub

Members

Member What it does
Shake (property, float, get/set) How hard the camera shakes. 0 is still, 1 is a good rumble (peaks at about half a degree), more for more. ⚠️ Not tested much in the game yet.
IsReady (property, bool) True if the camera can be shaken (the game's code is as expected).

Notes

  • The shake works in the driver, hood, bumper and chase views. Other views don't shake.
  • The shake fades in (about 0.2 seconds) and back out (about 0.4 seconds) by itself. Just set a value, then set it back to 0.
  • Shake is kept between 0 and 10. A value that isn't a real number (like NaN) becomes 0.
  • Setting Shake throws InvalidOperationException if the game isn't ready yet (still loading, or an unsupported game build). Setting it from Game.Tick is safe.
  • If your mod is reloaded, the shake stops.
  • On a game build the SDK doesn't support, the shake switches itself off: IsReady stays false and platform.log says so. If only some cameras could be set up, the log says it may work in some views only.

See also

Clone this wiki locally