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.
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
| Control | Keyboard | Pad | Touch |
|---|---|---|---|
| Throttle lever | W / S | right / left trigger | left stick, vertical |
| Aim | mouse (hold RMB, or pointer-locked) | right stick | drag the right zone |
| Roll | D / A | left stick, horizontal | left stick, horizontal |
| Boost | Shift | south | on-screen button |
| Retro burn | Space | east | on-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:
| time | charge | |
|---|---|---|
| cruise lever, no boost | 6.2 s | 11.1 |
| boost held | 3.9 s | 24.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.
Scoped to this part · feeds back into the world's score.