Log inGet started
◇
component · drop-in viewer
asset⌬ componentcomponentprimary: init.luau·originates fromworld 9e9e6b57-3…

RidgeCam

A fixed-angle follow camera for platforming that has to play on a phone, a controller and a keyboard.

byzero-proxy @ DESKTOP-DB3UJOJ·posted 2mo ago
What it does

RidgeCam

A fixed-angle follow camera for platforming that has to play on a phone, a controller and a keyboard.

The rig holds one heading and never turns. That is the point of it. CharacterController projects move against the active camera's forward and right onto the XZ plane, so a camera that never rotates turns camera-relative movement into absolute screen-direction control: the direction the stick points is the direction the character travels on screen, from every device, and no look input is needed to play. A steerable follow camera makes a phone player manage a second thumb to get anywhere; this one does not.

It follows with damping, and it treats height differently from the ground plane:

  • Ground follow is a plain damped chase, groundDamping seconds to cover ~63% of the gap.
  • Height follows a stepped anchor. While the subject stays within heightDeadZone metres of the anchor the camera holds its level, so a jump moves the character in frame and leaves the world still. Clearing the band — arriving on a new storey — pulls the anchor, and the camera eases up over heightDamping seconds. Without this the frame lurches vertically on every hop, which reads worst on a small screen.

The aim point leads the subject along its own horizontal velocity by leadDistance, read from CharacterController's velocity telemetry rather than differenced from position, so the vertical arc of a jump never tilts the shot.

Public fields: follow, offset (where the camera sits relative to the subject, in world axes), aimHeight, leadDistance, groundDamping, heightDamping, heightDeadZone.

Attach through Camera.behavior

local cam = entity(rigId).component.get("Camera")
cam.behavior = asset.ref("RidgeCam", "component")

The Camera owns the behavior slot, which is what lets it tell the rig when follow changes.

Player cameras: leave follow empty

Entering play drops and respawns PlayerPrototype subtrees, so the body is recreated with a new entity id every time. Set the target on the Camera and leave this rig's follow empty:

entity(rigId).component.get("Camera").follow = body

PlayerPrototype refreshes Camera.follow to the live body on every clone, and the rig reads that slot whenever its own follow is empty. Set follow only for a camera watching a fixed, non-respawning subject.

Choosing the offset

offset sets the viewing angle, and the angle sets how readable depth is. A steeper drop (a larger y relative to z) reads gaps along the depth axis more clearly and flattens the sense of height; a shallower one is more dramatic and makes depth harder to judge. The shipped default, {0, 12, -13}, is a ~42° look-down: close enough to a 45° isometric that a stick direction and a screen direction agree, without losing the vertical.

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

RidgeCam — a fixed-angle follow camera for platforming on any device. The rig never rotates. That is the whole point of it: `CharacterController` projects `move` against the active camera's forward and right, so a camera holding one heading turns camera-relative movement into ABSOLUTE screen-direction control. The stick direction is the direction the character travels on screen, on a keyboard, a pad and a thumb alike, and no look input is needed to play at all. A phone plays this one-thumbed. It follows with damping, and follows height more softly than the ground plane, so a jump does not lurch the whole frame vertically. Height also settles in steps rather than tracking the arc: the camera holds its level while the player hops, and eases when they land somewhere new. `follow` is left empty on a player camera. A PlayerPrototype clone mints a fresh body id per peer at spawn, so the id cannot be authored ahead of time; the engine binds `Camera.follow` on each peer's own clone, and this reads that slot.

resolveTarget( ) → string

approach(current: number, goal: number, tau: number, dt: number) → number

Exponential smoothing that behaves the same at any frame rate: the fraction of the remaining gap covered in `dt` given a time constant `tau`.

argtypedescription
currentnumber
goalnumber
taunumber
dtnumber

onFollowChanged(newFollow: any, oldFollow: any) → void

Called by Camera when its `follow` slot changes; re-poses onto the new subject.

argtypedescription
newFollowanyThe entity the camera now follows.
oldFollowanyThe entity it followed before.

update(dt: ?) → void

argtypedescription
dt?

Sub-parts

Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.

3items
This part has no composite children. See the Files segment for its leaf payloads.
backing path · RidgeCam.component

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported. This asset, its contents, and its direct deps are clean as of the latest commit.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ 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".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.