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

ExcavatorController

One operator, one tracked excavator. Attached by `scenes/main.scene/build.luau` to the **PlayerPrototype's body**, so every joining player gets their own machine and the engine's multiplayer rules hold.

by◐sdfsdf·posted 1mo ago
What it does

ExcavatorController

One operator, one tracked excavator. Attached by scenes/main.scene/build.luau to the PlayerPrototype's body, so every joining player gets their own machine and the engine's multiplayer rules hold.

What it does

JobHow
TravelPoses the chassis — writes its position and yaw each tick.
The armPoses boom, arm and bucket as kinematic child entities from three angles.
HydraulicsPoses each ram between two anchors every tick, because a ram is rigid and the span is what moves.
DirtFills the bucket when its cutting edge is inside the heap, empties it over the tipper's bed.
The tipperRaises the bed when full, resets the load, counts what has been hauled away.

Why the machine's pose is written rather than forced

The body is a player's avatar, and the engine drives a player body from the entity's transform: a velocity or an impulse written to it is accepted and then discarded, because the transform is what the body is posed from. So this component integrates the machine's motion itself and writes the pose — which is also how the engine's own CharacterController moves a player.

The rigid body and its collider stay on the chassis, so the machine is still a solid thing other bodies meet and a query can find. Because nothing in the solver holds it back, the step it is about to take is cast first (clearance): six rays from the front of the shell, and the step is shortened to the first thing it would run into. A tracked machine is stopped by what is in front of it, and the stop has to be found before the step rather than after it.

The rig it needs

By name, under the body it sits on:

  • rig — everything visual, dropped so the tracks' soles are at the body's centre minus 0.86 (the collider's own floor)
  • house, boom_pivot, arm_pivot, bucket_pivot — the joint chain
  • bucket_point — where the bucket's cutting edge bites
  • dirt_load — the dirt drawn in the bucket
  • boom_ram_barrel / boom_ram_rod, arm_ram_barrel / arm_ram_rod

The joint angles and the reach every anchor is measured from come from Construction.RIG, so the geometry the scene build makes and the movement this component drives cannot drift apart.

By name, in the scene: dirt_heap, dirt_clump_1..3, truck_bed, truck_bed_load, truck_bed_point.

Controls

ExcavatorControls.inputMap: throttle (W/S), steer (A/D), slew (Q/E), boom (up/down), arm (left/right), bucket (Z/X) — each carrying keyboard, gamepad and touch.

Related

  • Hud — reads this component's published fields and shows them.
  • types/component, scenes/player-setup — the shape this follows.

Interface

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

conforms to

zero/source-extract/v2

ExcavatorController — one operator, one tracked excavator. Attached by `scenes/main.scene/build.luau` to the PlayerPrototype's body, so every joining player gets their own machine. The component does four jobs: 1. Travel. The chassis is a KINEMATIC body that this component poses, the way the engine's own character controllers pose a player's body: a player's avatar takes its pose from its transform, so writing the transform is what moves it, and a velocity or an impulse written to it goes nowhere. Its collider still stands in the physics world, so other bodies meet the machine, and the step it is about to take is cast against the world first — a tracked machine is stopped by what is in front of it, and the stop has to be found before the step is taken. 2. The arm. Boom, arm and bucket are kinematic child entities posed from three angles. Hydraulics are rigid in reality, so posing them is the honest model, and it means the bucket's world position is exact. 3. Dirt. The bucket fills when its cutting edge is inside the heap and empties when it is over the truck bed. Position is the whole mechanic: no extra key to press, so nothing to discover. 4. The truck. When the bed is full it tips, the load resets and the count goes up — the reason to keep digging. State lives in module-locals, the pattern the engine's own controllers use for the tick's own accumulation (`third_person_follow` does the same). It is correct here because a peer has exactly one local machine.

resolveParts( ) → void

resolveSite( ) → void

Everything the tick needs that lives outside the machine. Resolved the same lazy way, because the site may be placed after the machine too.

clamp(v: ?, lo: ?, hi: ?) → void

Helpers

argtypedescription
v?
lo?
hi?

heapSizeFactor( ) → void

The heap shrinks toward its own base, which is where its origin sits, so it reads as dirt being taken away rather than as the pile floating off.

applyHeapVisual( ) → void

place(e: ?) → void

argtypedescription
e?

rotX(y: ?, z: ?, a: ?) → void

argtypedescription
y?
z?
a?

poseRam(barrel: ?, rod: ?, ax: ?, ay: ?, az: ?, bx: ?, by: ?, bz: ?) → void

Pose one hydraulic ram between two anchors, both in the same parent's space. A ram is rigid: its rod is a cylinder that reaches further, so the span is what moves, not the part.

argtypedescription
barrel?
rod?
ax?
ay?
az?
bx?
by?
bz?

clearance(body: ?, forward: ?, dir: ?, step: ?) → void

How far the machine may move this tick before something solid stops it. The body's pose is written by this component (see driveTravel), so the solver will not hold it back — the cast is what keeps the tracks out of the tipper and the barriers.

argtypedescription
body?
forward?
dir?
step?

driveTravel(dt: ?) → void

Travel. The machine's body is a player's avatar, and the engine drives a player body FROM the entity's transform — writes to the body's velocity are accepted and then discarded, because the transform is what the body is posed from. So this integrates the machine itself and writes the pose, which is also how the engine's own `CharacterController` moves a player. The rigid body and its collider stay, so the machine still holds other bodies off and can be found by a query.

argtypedescription
dt?

applyRigPose( ) → void

Write the three joint angles onto the chain. Kept apart from advancing the angles so the authoring view can pose the rig without running the game.

driveArm(dt: ?) → void

argtypedescription
dt?

poseHydraulics( ) → void

Anchors are stated in the frame each end belongs to, then brought into the parent's frame so a ram can be posed between them.

updateDirt(dt: ?) → void

argtypedescription
dt?

updateTruck(dt: ?) → void

argtypedescription
dt?

publishState( ) → void

awake( ) → void

Lifecycle

onControl(name: ?, fn: ?) → void

The touch half of the arm and the bucket. A scheme's control set is DATA — this component is handed a map and reads whatever controls it declares — so they are read by name rather than reached for as members, and a scheme that declares none of them is simply a scheme with no touch half.

argtypedescription
name?
fn?

start( ) → void

update(dt: ?) → void

argtypedescription
dt?

editorUpdate(dt: ?) → void

While authoring, the game does not run, but the machine should still be drawn in a sensible pose with its rams where they belong rather than folded into the boom's pivot. This is the pose, not the simulation.

argtypedescription
dt?

onDestroy( ) → void

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.