vehicle.getSpeed

Section: Vehicle

What it does

vehicle.getSpeed reads Speed on a vehicle object. It takes id.

Signature

vehicle.getSpeed(id)

Arguments

  • id

Example · generated

function update(dt) {  const speed = vehicle.getSpeed('main');}

vehicle.getSpeed is called with values of the shape its signature asks for. The code sits in update(dt), which the engine calls every frame: dt is the time since the last one, in seconds.

6 members in vehicle