Crawl Marker
A feature-rich race checkpoint marker with a floating arrow, two roadside flags, and a distant visibility column. Supports multiple color modes, fade distances, line-of-sight occlusion avoidance, and
A feature-rich race checkpoint marker with a floating arrow, two roadside flags, and a distant visibility column. Supports multiple color modes, fade distances, line-of-sight occlusion avoidance, and minimap drawing.
Class API (OOP via metatable)
| Method | Signature | Description |
|---|---|---|
C:init | (id) | Initializes state, springs, mode info |
C:update | (dt, dtSim) | Updates all visual elements per frame |
C:setToCheckpoint | (wp) | Positions marker, flags, column from waypoint data |
C:setMode | (mode) | Transitions to a visual mode with color lerp |
C:drawOnMinimap | (td) | Draws colored circle on minimap |
C:setVisibility | (v) | Shows/hides all sub-objects |
C:hide/show | () | Visibility shortcuts |
C:createMarkers | () | Creates arrow, left/right flags, center column |
C:clearMarkers | () | Destroys all created objects |
C:show | () | Shows the marker (sets visibility to true) |
C:createObject | (shapeName, objectName) | Creates a TSStatic object for the marker |
Visual Modes
| Mode | Color | Description |
|---|---|---|
default | White | Standard checkpoint |
inactive | Gray | Already passed |
current | Orange | Active target |
recovery | Yellow | Recovery point |
bonus | Purple | Bonus checkpoint |
skipped | Red | Missed checkpoint |
final | Blue | Final checkpoint |
finished | Green | Completed (no base) |
hidden | Black | Invisible |
Components
| Object | Shape | Behavior |
|---|---|---|
| Arrow | s_mm_arrow_ribbon_down.dae | Floating, bobbing, faces camera, LOS occlusion avoidance |
| Left Flag | flagMarkerOrange.dae | Placed to the right of path direction on terrain |
| Right Flag | flagMarkerOrange.dae | Placed to the left of path direction on terrain |
| Column | s_single_faded_column_rect.dae | Visible only at 200m+, height scales with distance |
Arrow Behavior
- Height: Uses
TemporalSpringto smoothly animate; starts low, rises after delay - LOS avoidance: Raycasts upward in 2-unit increments (up to 100) to avoid occlusion
- Scale: Shrinks to 0.3 within 15m, normal at 2.0; finished/inactive markers 40% smaller
- Bobbing:
sin(clock * 1.9 + offset) * 0.4for natural movement
Flag Behavior
- Positioned ±2.5 units perpendicular to path direction
- Snaps to terrain height with smooth normal alignment
- Falls back to
be:getSurfaceHeightBelowifcore_terrainunavailable
Column Behavior
- Fade in: 200–300m distance (linear alpha ramp)
- Height scale: 50–200 units, scaling with distance (200–1200m)
- Full opacity at 300m+, hidden below 200m
How It Works
- Constructor creates instance with spring smoothers for height, scale, and alpha
createMarkers()spawns arrow, two flags, and column TSStatic objectssetToCheckpoint(wp)positions everything, captures path direction for flag placementupdate()each frame handles:- Color lerping between mode transitions (0.5s duration)
- Alpha fade based on 2D distance from camera
- Arrow LOS checks and height animation
- Flag terrain snapping and rotation
- Column distance-based visibility
Usage Examples
local marker = require('scenario/raceMarkers/crawlMarker')(1)
marker:createMarkers()
marker:setToCheckpoint({
pos = vec3(100, 200, 50),
radius = 5,
dir = vec3(0, 1, 0), -- path direction
delay = 0.5, -- delay before arrow rises
fadeNear = 5,
fadeFar = 25,
})
marker:setMode('current')
-- Each frame
marker:update(dt, dtSim)
-- Cleanup
marker:clearMarkers()Key Notes
- Most complex race marker with 4 sub-objects and multiple animation systems
- Uses
castRayStaticfor arrow LOS avoidance - ensures arrow is always visible - Path direction (
wp.dirorwp.nextPos) determines flag placement sides - Column provides long-range visibility when arrow would be too small to see
- All objects added to
ScenarioObjectsGroupwithcanSave = false
See Also
- Race Marker: Attention - Floating Arrow Checkpoint Marker - Related reference
- Race Marker: Cylinder - Base + Cylinder Checkpoint Marker - Related reference
- None Marker - Invisible Race Checkpoint Marker - Related reference
- Scenario System Guide - Guide
Attention Marker
A race checkpoint marker that displays a single floating arrow ribbon. Designed for walking/on-foot scenarios with a bobbing animation and height offset when the player is nearby.
Cylinder Marker
A classic race checkpoint marker consisting of a ground base ring and a tall transparent cylinder. Color-coded by checkpoint type with distance-based alpha fading.