Talos docs

RoadDriverProps

Since 0.7

The built-in road-driver behaviour's props: which road it follows and how it takes it.

Plain text

Signature

export interface RoadDriverProps {
  /** The road entity's id (the entity with the `road` component). Required. */
  road?: string
  /** Metres ahead it steers toward, at a standstill. Default 8. */
  lookAheadM?: number
  /** Metres more look-ahead per m/s of speed. Default 0.3. */
  lookAheadPerSpeed?: number
  /** Metres to the right of the centre line it keeps to (negative is left). Default 0. */
  laneOffsetM?: number
  /** Its own speed limit, m/s. Default none: the vehicle's top speed. */
  maxSpeed?: number
  /** The share of g it takes a bend at. Default 0.8 (the kart preset); about 0.6 for a road car. */
  cornerGrip?: number
  /** Pinned this long, s, before it backs out. Default 1.5. */
  wedgedAfter?: number
  /** How long one back-out reverses, s. Default 1. */
  backOut?: number
  /** Emitted once, with `{ entity, tries }`, after three back-outs in a row fail. Default `stuck`. */
  stuckEvent?: string
  /** An event to wait for before driving (a race countdown's "go"); until it comes it holds still. Default none: it drives at once. */
  startOn?: string
  /** An event that stops it again (the finish): it brakes to a stop and holds still. `startOn` sends it off again. */
  stopOn?: string
}

Import: import type { RoadDriverProps } from "@argus/gameplay"

Members

MemberSignatureDescription
roadroad?: stringThe road entity's id (the entity with the road component). Required.
lookAheadMlookAheadM?: numberMetres ahead it steers toward, at a standstill. Default 8.
lookAheadPerSpeedlookAheadPerSpeed?: numberMetres more look-ahead per m/s of speed. Default 0.3.
laneOffsetMlaneOffsetM?: numberMetres to the right of the centre line it keeps to (negative is left). Default 0.
maxSpeedmaxSpeed?: numberIts own speed limit, m/s. Default none: the vehicle's top speed.
cornerGripcornerGrip?: numberThe share of g it takes a bend at. Default 0.8 (the kart preset); about 0.6 for a road car.
wedgedAfterwedgedAfter?: numberPinned this long, s, before it backs out. Default 1.5.
backOutbackOut?: numberHow long one back-out reverses, s. Default 1.
stuckEventstuckEvent?: stringEmitted once, with { entity, tries }, after three back-outs in a row fail. Default stuck.
startOnstartOn?: stringAn event to wait for before driving (a race countdown's "go"); until it comes it holds still. Default none: it drives at once.
stopOnstopOn?: stringAn event that stops it again (the finish): it brakes to a stop and holds still. startOn sends it off again.