API ReferenceGE ExtensionsscenarioraceMarkers
Overhead Marker
A race checkpoint marker that displays a single floating arrow shape above the waypoint position. The arrow faces the camera, bobs up and down, and color-lerps between modes.
A race checkpoint marker that displays a single floating arrow shape above the waypoint position. The arrow faces the camera, bobs up and down, and color-lerps between modes.
Class API (OOP via metatable)
| Method | Signature | Description |
|---|---|---|
C:init | (id) | Initializes state: position, radius, color, fade distances, mode |
C:update | (dt, dtSim) | Per-frame: color lerp, distance fade, arrow rotation/position |
C:setToCheckpoint | (wp) | Sets position/radius from waypoint, repositions arrow |
C:setMode | (mode) | Transitions to new mode, triggers show/hide |
C:setVisibility | (v) | Shows/hides the arrow TSStatic |
C:hide / C:show | () | Shorthand for setVisibility |
C:createObject | (shapeName, objectName) | Creates a TSStatic with instance render data |
C:createMarkers | () | Spawns the arrow TSStatic |
C:clearMarkers | () | Deletes all spawned objects |
Mode Colors
| Mode | Color (RGB) | Description |
|---|---|---|
default | {1, 0.333, 0} | Orange - normal checkpoint |
next | {0, 0, 0} | Black - next-after-current |
start | {0.4, 1, 0.2} | Green - start/rolling start |
lap | {0.4, 1, 0.2} | Green - lap boundary |
final | {0.1, 0.3, 1} | Blue - final checkpoint |
branch | {1, 0.6, 0.07} | Yellow - branch point |
hidden | {0, 0, 0} | Black - hidden (auto-hides) |
How It Works
- Arrow shape: Uses
s_mm_arrow_ribbon_down.daemesh - Camera facing: Each frame, computes direction from marker to camera and rotates arrow via
quatFromDir(fwd:z0()) - Distance fade: Alpha fades from
fadeNear(5) tofadeFar(25) using inverse lerp - Bobbing: Arrow position oscillates vertically with
math.sin(os.clock() * 1.9) * 0.4 - Color transition: Lerps between old and new mode colors over
colorLerpDuration(0.3s) - instanceColor1: Set to white with matching alpha for secondary material channel
- Auto-hide: When mode is
hiddenand color timer expires, callshide()
Usage Example
local createMarker = require("scenario/raceMarkers/overhead")
local marker = createMarker(1)
marker:createMarkers()
marker:setToCheckpoint({pos = vec3(100, 200, 50), radius = 5})
marker:setMode('default')
-- Per frame:
marker:update(dt, dtSim)Key Notes
- Arrow scales to
vec3(2,2,2)during updates - Objects are registered in
ScenarioObjectsGroupfor automatic cleanup - Uses
canSave = falseso markers don't persist in level saves
See Also
- Race Marker: Attention - Floating Arrow Checkpoint Marker - Related reference
- Race Marker: Crawl Marker - Arrow + Flag + Column Checkpoint - Related reference
- Race Marker: Cylinder - Base + Cylinder Checkpoint Marker - Related reference
- Scenario System Guide - Guide
None Marker
A no-op race marker implementation. All methods exist but do nothing, making checkpoints completely invisible. Used when no visual marker is desired.
Ring Marker - 3D Ring Checkpoint Marker
A race checkpoint marker that renders a 3D ring (hoop) at the waypoint position. Supports normal/up orientation, scales to waypoint radius, and swaps between regular and finish ring shapes based on mo