Crumple Zone: Crash Test Dummy Simulator
README.md
CrashRig
The shared crash-test rig. Put it on one synced scene entity. It needs no sibling components: it spawns everything a test needs through the crashCars, crashDummies and crashObstacles parts.
- Who runs the test. The peer that owns the entity is the authority: it spawns the car, the dummy in
its seat and the obstacle (all synced), launches the car, measures it and writes the
CrashResultinto the syncedresultfield. Every player sees the same test and the same numbers. - Who can ask.
rig:request("prepare" | "run" | "reset" | "clear", config?)works from any peer; a non-owner's request travels to the owner overmultiplayer.send. - How a run goes.
statemoves throughidle,preparing,ready,countdown,running,settlingandresults.messageis one human line for a HUD. - How it launches. Cars are towed (speed builds over 60 % of
runup, released 1 m out) or driven (config.mode = "drive"). Rear hits launch the moving barrier into the parked car. Side hits slide the car sideways into the pole. - Replay. Every peer records what it sees;
rig:replay{ speed = 0.25 }plays it back locally as ghosts, andrig:stopReplay()ends it. The live crash entities sit on the render layersdefault crash. - Changing owner. A new owner that finds a test half-run sets it up again.
Fields: origin, runup, countdown, config, state, testId, result, carId, shellId,
dummyRoot, dummyHead, dummyBodies, obstacleRoot, moverId, spawned, message.
See the package README for the CrashResult fields and measured numbers.