Log inGet started
World

Torque Valley: Driving, Drift and Crash Sandbox

README.md

Car

The driver of a torqueCars car. Sits on the chassis torqueCars.assemble builds (with its Physics, CompoundCollider, ShaftNetwork, four WheelCollider children and the SoftBody body). Each physics step on the owning peer it runs the engine (throttle, idle governor, turbo, rev limiter), the automatic clutch, the gearbox (auto or manual shifts, reverse), brakes with ABS, traction control, speed-sensitive steering, per-wheel ground grip from driveSurfaces, drag and rolling resistance, and counts crashes. It publishes the driving contract's named values every frame (see the package's CONTRACT.md).

Fields: kind, look, paint, engine, gearbox, diff, tyres (changing any rebuilds the car in place), control (player / script / none), autoShift, assists, and the script intent fields. Methods: setIntent{throttle, brake, steer, handbrake, reverse}, shiftUp(), shiftDown(), setPart(slot, name), reset(), respawn(pos?, yaw?), setSpawn(pos, yaw), gearLabel(), info(), telemetry().

local car = require("torqueCars.assemble").spawn({ kind = "drift", position = vector.create(0, 0.2, 0), control = "script" })
car.component.get("Car"):setIntent({ throttle = 0.5, steer = 0.3 })