DriveCam
Switches the camera it sits on between eight car views with one setting, `mode`: `chase`, `cockpit`, `hood`, `bumper`, `orbit`, `tv`, `heli`, `rear`. Attach it to an entity with a `Camera` (the player prototype's camera rig included). It writes the Camera's `behavior` to the righ…
DriveCam
Switches the camera it sits on between eight car views with one setting,
mode: chase, cockpit, hood, bumper, orbit, tv, heli, rear.
Attach it to an entity with a Camera (the player prototype's camera rig
included). It writes the Camera's behavior to the right rig (the builtin
chase, mount or orbital_follow, or this package's TvCam / HeliCam), tunes it
for the car (distance from the car's size, mount points from
car.mountSeat / car.mountHood / car.mountBumper), sets the field of view,
and in chase widens it with speed.
cam.component.add("DriveCam", { mode = "chase", car = myCar })
cam.component.get("DriveCam"):cycle()
With cycleKey on, the cycleCamera control of driveCams.cameraControls
(C, right-stick press / d-pad up, a CAM touch button) steps through
cycleModes (all eight when empty). Fields: mode, car, cycleKey,
cycleModes, speedFov, fovBoost, fovSpeed, orbitSpin, inputMap.
Methods: cycle(dir?), setMode(mode), info().
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2DriveCam — one camera, every car view, switched by one setting. Put it on a camera entity (one with a `Camera`), the player camera rig included. `mode` picks the view and switches live: chase behind the car (@builtin::controller.chase), FOV widening with speed cockpit the driver's seat (@builtin::controller.mount at car.mountSeat), head moves with g-forces hood on the bonnet (car.mountHood) bumper low on the front bumper (car.mountBumper) orbit free orbit round the car (@builtin::controller.orbital_follow) tv trackside TV cameras that pan, zoom and cut (driveCams.TvCam) heli a helicopter shot from high above (driveCams.HeliCam) rear looking back from the tail The car is `car`, or, when empty, what the Camera already follows (the player prototype keeps that pointed at the local player's body). With `cycleKey` on, the `cycleCamera` control (C, right-stick press / d-pad up, a CAM touch button) steps through the modes. local cam = layers.active.camera.entity cam.component.add("driveCams.DriveCam", { mode = "chase", car = myCar }) cam.component.get("driveCams.DriveCam").mode = "cockpit"
idOf(v: any) → string
| arg | type | description |
|---|---|---|
| v | any |
cameraComp( ) → any
followed( ) → string
cycleList( ) → void
cycle(dir: number?) → string
Step to the next mode in the cycle (dir -1 goes back). Answers the new mode.
| arg | type | description |
|---|---|---|
| dir | number? |
setMode(mode: string) → boolean
Switch to `mode` (one word). False for an unknown mode.
| arg | type | description |
|---|---|---|
| mode | string |
info( ) → any
What the camera is doing: { mode, car, behavior, fov, mounts }.
bindControls( ) → void
unbindControls( ) → void
awake( ) → void
update(dt: number) → void
| arg | type | description |
|---|---|---|
| dt | number |
onDestroy( ) → void
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Showing up to 3 levels deep. Open a part to see what it holds further down.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.