Freeroam Cruising
Reference for `gameplay_drift_freeroam_cruising`, which automatically shows/hides the drift angle UI when the player sustains a drift chain while in freeroam.
Reference for gameplay_drift_freeroam_cruising, which automatically shows/hides the drift angle UI when the player sustains a drift chain while in freeroam.
Dependencies
gameplay_drift_general, gameplay_drift_drift
Exports
| Function | Signature | Description |
|------
| M.dependencies | table | {"gameplay_drift_general", "gameplay_drift_drift"} |----|-----------|-------------|
| onUpdate | (dtReal, dtSim, dtRaw) | Detect start/end of sustained drifting |
Internals
| Symbol | Value | Purpose |
|---|---|---|
driftDuration | 1.5 s | Min single drift duration to trigger |
minDriftChain | 2 | Min chained drifts required |
timeToDisableUI | 2.3 s | Seconds after drift ends to hide UI |
isDriftCruising | bool | Current cruising state |
How It Works
-- Enable: player is in freeroam, drifting for 1.5+ seconds, with 2+ chain
if context == "inFreeroam"
and driftDuration >= 1.5
and chainedDrifts >= 2 then
-- Show drift angle UI via gameplay_drift_display.onDriftCruisingToggled(true)
end
-- Disable: stop drifting for 2.3 seconds
-- Timer resets every frame while still drifting
-- When timer expires → hide UIKey Behaviors
- Only activates in
"inFreeroam"context (not during challenges or missions) - Calls
gameplay_drift_display.onDriftCruisingToggled(true/false)which shows only the drift angle overlay (not full mission UI) - The 2.3-second disable delay prevents flickering during brief drift transitions
- Profiler tracks garbage collection when general debug is enabled
Module Variables
| Variable | Type | Description |
|---|---|---|
M.dependencies | table | {"gameplay_drift_general", "gameplay_drift_drift"} |
M.onUpdate | (dtReal, dtSim, dtRaw) | - |
See Also
- drift/freeroam/driftSpots - Freeroam Drift Zone Manager - Related reference
- Gameplay Systems Guide - Guide
Drift Stunt Zones
Reference for `gameplay_drift_stuntZones`, which manages the lifecycle, detection, rendering, and scoring of drift stunt zones (donuts, drift-throughs, hit poles, near poles).
Freeroam Drift Spots
Reference for `gameplay_drift_freeroam_driftSpots`, which manages freeroam drift zones - detecting when the player drifts through a start line, running the challenge, tracking scores/highscores, and i