vehicleController.package
README.md
vehicleIntent
In a world that installs the Controllers library (
world.installLibrary({ world = "034d26cf-dc3d-4123-abad-3944f97c6a60", as = "controllers" })), every package name on this page is written with@controllers::in front of it, andasset.list("component")lists each one under that name.
The driving intent a player gives a ground vehicle, read from an input map:
throttle, steer, brake, handbrake, boost, a recover request and camera zoom.
VehicleController drives a car's WheelColliders from it; a hand-written
driver reads the same readers.
local VehicleIntent = require("vehicleController.vehicleIntent")
local drive = VehicleIntent.vehicle() -- the package's vehicle input map
drive:start() -- takes the controls; the walking scheme stands down
print(drive:getThrottle(), drive:getSteer())
drive:stop() -- hands them back
opts.inputMap takes another input map as an asset ref
(asset.resolve(name, "inputMap")); a map that leaves a control out answers
that reader with its neutral value. opts.label names the claim in
Zin.scheme.live().