Log inGet started
Package

ShipHelm.component

Newest version

README.md

ShipHelm

The Aurelian's flight core. It sits on the scene's PlayerPrototype body, so it is the local player, and it is the only thing that writes the ship's transform.

Flying it

ControlKeyboardPadTouch
Throttle leverW / Sright / left triggerleft stick, vertical
Aimmouse (hold RMB, or pointer-locked)right stickdrag the right zone
RollD / Aleft stick, horizontalleft stick, horizontal
BoostShiftsouthon-screen button
Retro burnSpaceeaston-screen button

The throttle is a lever, not a key. W and S move a setting between -0.4 and 1.0 at a fixed rate; letting go leaves it where it is and the drive keeps burning at it. You set a cruise and you fly it. Space is a retro burn that fires against the momentum you already own and closes the lever as it goes — that is how you stop, and it costs charge like any other burn.

What it publishes

Everything below lands on Drift.state every frame. Read these; never write them from another slice.

speed · boosting · heading (unit bow direction) · throttle (the lever, not the speed) · braking · bank (radians of roll) · turnRate · burnRate (charge/s leaving the tank now) · shake (0..1 hull impact) · maxSpeed · shipUp · shipRight

Methods

local helm = Drift.ship().component.get("ShipHelm")
helm:aimAt(x, y, z)   -- point the bow at a world position, killing the swing
helm:halt()           -- take off all momentum, throttle and rotation at once
helm:telemetry()      -- { yaw, pitch, roll, throttle, speed, boosting, braking }

aimAt and halt are what a spawn, a respawn or a tow should use instead of writing the transform directly.

Tuning

Drift.config.ship, set from this file at awake. Thrust honours Drift.state.upgrades.thrust, so salvage spent at the waystation is felt at the helm.

Measured

Crossing 700 units to a site, from a standstill, on the shipped numbers:

timecharge
cruise lever, no boost6.2 s11.1
boost held3.9 s24.0

Boost is 1.6x faster and costs 2.2x as much. A retro burn takes the ship from the 215 u/s boost cap to a dead stop in about 2 seconds.

Axis

The hull is authored with its bow at local +Z. ship.flightmath's header explains why the helm flies that axis and what it costs — read it before changing anything about rotation here.