main.scene
- .build.assets465 B
- .build.state16 B
- .metadata17 B
- README.md2.7 KB
- build.luau18.8 KB
- dirt_heap.mesh
- dirt_load.mesh
- entrypoint.luau4.9 KB
- exc_arm.mesh
- exc_boom.mesh
- exc_bucket.mesh
- exc_counterweight.mesh
- exc_track.mesh
- machine_dark.material
- machine_steel.material
- machine_yellow.material
- safety_orange.material
- scene.json140 KB
- site_concrete.material
- site_dirt.material
README.md
main
A construction site with a working excavator, authored as code in build.luau.
What is here
A dirt heap and a tipper truck, placed in reach of one another, and one tracked excavator the player operates. Around them: a compacted-earth apron, traffic cones, barriers and a few concrete blocks.
The machine is the scene's player: it is the PlayerPrototype's body, so
the engine mints one per joining user and nothing here is singleplayer. See
core/multiplayer for why that matters.
The dig loop
- Drive to the heap (W/S to travel, A/D to steer).
- Swing the house so the bucket is over the heap (Q/E) and lower it (arrow keys for boom and arm, Z/X for the bucket).
- The bucket fills on its own once its cutting edge is in the heap.
- Swing to the tipper and lower the bucket over the bed to empty it.
- When the bed is full the tipper raises, the load is counted, and the bed comes back down for the next one.
Nothing is a hidden key press: the dirt moves when the bucket is in the right place, which is what makes the arm the whole game.
Why the machine is authored, not imported
An excavator is a jointed machine — the house swings on its ring, and the boom,
arm and bucket each turn on a pin. A single imported model cannot articulate,
so the machine is built from rigid parts, each parented to the part it moves
with. Construction.module makes the shapes; every measurement comes from
Construction.RIG, so the geometry and the controller that drives it cannot
drift apart.
Who does what
| Asset | Job |
|---|---|
Construction.module | The geometry: track, bucket, boom, arm, heap, and the rig's measurements. |
ExcavatorControls.inputMap | The six controls, each carrying keyboard, gamepad and touch. |
ExcavatorController.component | Operates the machine and runs the dirt loop. |
Hud.component + ExcavatorHud.module | The on-screen display. |
The parts worth knowing
- The body's origin is the centre of its collider, 0.86 m above the ground.
Everything visible hangs under a child named
rig, dropped by that half height, so the tracks' soles sit at y = 0.rideHeighton the controller carries the difference. - A
BoxCollideron a child does not reach the ancestor's body — the body keeps its own default box. The machine's box is therefore stated on the body itself. - A player body takes its pose from its transform. Writes to its velocity
are accepted and then discarded, because the transform is what the body is
posed from.
ExcavatorControllerintegrates the machine itself and writes the pose, casting ahead of each step so the tracks stop at what is in front of them.