Esc to clear, Enter to open the best match, click an export to open it in its page
Interactions & UI

Camera System

Scripted cameras for cutscenes, intros, showrooms and cinematics. One camera plays at a time, and it belongs to the resource that started it: when that resource stops, WHIP hands the view back.

Three ways to use it

Every export is on the Camera API page. An orbit frames a bike and a bus alike, and a shot inside an MLO draws its interior.

Playing a sequence

-- Saved in the Camera Creator, by name (from a thread: the first time, it's fetched from the server)
exports.whip_core:PlayCameraSequence('intro')

-- Round a car you hand it ('target' is the Creator's "picked thing")
exports.whip_core:PlayCameraSequence('car_reveal', { subjects = { target = veh }, async = true })

-- Or written out (what Copy code gives you)
exports.whip_core:PlayCameraSequence({
    letterbox = true,
    keys = {
        { t = 0, move = 'glide', ease = 'smooth',
          shot = { kind = 'fixed', pos = { x = -75.2, y = -819.4, z = 326.1 }, rot = { x = -12, y = 0, z = 140 }, fov = 50 } },
        { t = 4000, move = 'orbit', around = 'left',
          shot = { kind = 'orbit', subject = 'vehicle', yaw = 30, pitch = 8, fit = 1.2, fov = 40, turn = 6 } },
        { t = 9000, shot = { kind = 'orbit', subject = 'vehicle', yaw = 160, pitch = 4, fit = 0.9, fov = 36 },
          shake = { amount = 0.3, freq = 6 } },
    },
})

A sequence is checked before anything goes up; a mistake returns false, why naming the key and field. 'player' and 'vehicle' need nothing; any other subject name is one you pass in subjects, as an entity or a place { x, y, z, h }. A subject that goes away mid-sequence holds the last picture.

Orbiting anything

-- A showroom: the player turns it with the mouse (or right stick) and zooms with the wheel
exports.whip_core:OrbitCamera(veh, { yaw = 35, pitch = 12, fit = 1.3, fov = 40, turn = 6 })
-- ...when they're done
exports.whip_core:StopCamera()

Stopping

StopCamera() stops the camera your resource started; you don't need it in onResourceStop.

Cameras wait unless you pass async = true. PlayCamera (with its default exitKey), paths and sequences hold your thread until they end; a loop path, until StopCamera.

The Camera CreatorServer owners#

Making a cinematicServer owners#

Place your cameras in the Camera Creator (each key is one), press F9 to play in game as your character, and record the screen with OBS or any recorder. F5 rolls the timeline live (again to cut back), Page Down / Page Up or Num 1-Num 9 cut between cameras, and F9 returns to the editor. A rolling shot leaves a clean screen (F6 hides chat), and with Plays round set to your vehicle, the cameras are placed round the car wherever it is.

The driving cameraServer owners#

A smooth chase camera for cars, motorbikes and quads, which each player switches on in the pause menu (Server Settings → Vehicles → Smooth driving camera); it's off unless you make it the default. It steps aside for aiming, GTA's cinematic camera, death and any other script's camera, then comes back, so nothing you write needs to know about it. Switch it off for everyone, change the default or set the shake in Config.DrivingCamera (/whip → Settings → Config → Vehicles).

Each player also picks its Camera style. Consistent stays behind the car the same way all the time. Cinematic frames the car by what it's doing: back and up in the air so the landing is in frame, further back on softer springs in a drift, lower and closer with a wider view in a burnout from a stop, and closer and much wider on nitrous (any pull harder than a launch). Config.DrivingCamera.Style ('consistent' or 'cinematic') is the style a player who never chose gets.