Skip to content

DriverSeatAI ​

Inherits: SeatAI < Resource

Drives the mount where its own behavior sends it. The NPC (or the companion) still decides where to go, with its behavior and combat scripts as always: this AI takes the heading of its navigation and turns it into throttle and steering, so the mount moves the way the drive logic of its seat says (a tank turns in an arc instead of spinning on the spot).

Properties ​

floatslow_distance5.0
floatsteering_gain1.5
floatturn_first_degrees70.0

Methods ​

Stringget_ai_type_name()
Stringget_ai_type_description()
Dictionaryget_field_descriptions()
Vector2think( _delta: float )

Property descriptions ​

float slow_distance = 5.0 ​

The mount slows down when it is nearer than this to the end of its path (units)

float steering_gain = 1.5 ​

How strongly it steers towards the heading (1 = it turns fully at about 57 degrees of error)

float turn_first_degrees = 70.0 ​

It does not drive forward while the heading is more than this many degrees off (it turns first)

Method descriptions ​

String get_ai_type_name() ​

What this AI is called in the editor list (from SeatAI)

String get_ai_type_description() ​

A sentence about what this AI does, for the editor (from SeatAI)

Dictionary get_field_descriptions() ​

The sentences the editor shows as tooltips: {name of an exported variable: text}. An AI of your own adds its variables (call super and merge) (from SeatAI)

Vector2 think( _delta: float ) ​

Every physics frame while the AI acts. Return the move input of the seat (x right, y forward, each -1 to 1). Override this (from SeatAI)