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
- A sequence made in the Camera Creator: a timeline of shots and the moves between them. Play it by name, or paste it as code:
PlayCameraSequence. - An orbit round anything, up until you stop it, which the player can turn and zoom:
OrbitCamera. - One fixed shot (
PlayCamera), or a simple path through points (PlayCameraPath, which plays as a sequence).
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.
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#
- Turn it on in
/whip→ Settings → Config → Experimental features (an unfinished prototype, off by default). It's a row at the end of the/wdev menu. - Fly with the right mouse button held, then WASD, Space and Ctrl; on a controller the sticks fly. G adds a key at the playhead; Space plays.
- Each key is a shot (Fixed, Orbit, Chase, Mounted or Track) of you, your vehicle or a picked thing, and moves on to the next by Cut, Glide, Spring or Orbit.
- Save keeps it on the server by name, for any admin to open and any script to play (
PlayCameraSequence('intro')). Copy code copies it as a Lua call; your draft is kept on this PC.
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.