API ReferenceGE ExtensionsscenarioraceMarkers
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.
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.
Class API (OOP via metatable)
| Method | Signature | Description |
|---|---|---|
C:init | (id) | Initializes state, smoothers, visibility |
C:update | (dt, dtSim) | Updates position, rotation, color, walking offset |
C:setToCheckpoint | (wp) | Sets position and scale from waypoint data |
C:setMode | (mode) | Sets mode ("hidden" or visible) |
C:setVisibility | (v) | Shows/hides the marker object |
C:hide | () | Shorthand for setVisibility(false) |
C:show | () | Shorthand for setVisibility(true) |
C:createMarkers | () | Creates the TSStatic arrow object |
C:clearMarkers | () | Destroys all created objects |
C:createObject | (shapeName, objectName) → TSStatic | Helper to create a marker object |
Visual Properties
- Shape:
s_mm_arrow_ribbon_down.dae(single downward arrow) - Color: Fixed blue
{0, 0.4, 1}with full opacity - Animation: Vertical bobbing via
sin(os.clock() * 3)scaled by marker size - Rotation: Always faces the camera (billboard-style via
quatFromDir) - Walking offset: Rises by up to 1 unit when player is within 4 units (smooth transition)
How It Works
- Created via constructor function:
local marker = require('scenario/raceMarkers/attention')(id) createMarkers()spawns a TSStatic arrow shape inScenarioObjectsGroupsetToCheckpoint(wp)positions the marker at waypoint locationupdate(dt)each frame:- Calculates rotation to face camera
- Applies walking-mode height offset (smooth transition using
TemporalSmoothingNonLinear) - Adds bobbing animation
- Updates instance color and render data
- Mode transitions use color lerping over
colorLerpDuration(0.3s)
Usage Examples
-- Create and set up an attention marker
local attentionMarker = require('scenario/raceMarkers/attention')(1)
attentionMarker:createMarkers()
attentionMarker:setToCheckpoint({pos = vec3(100, 200, 50), radius = 2})
attentionMarker:setMode('default')
-- Update each frame
attentionMarker:update(dt, dtSim)
-- Clean up
attentionMarker:clearMarkers()Key Notes
- Uses the OOP pattern: constructor returns an instance table with
Cmetatable - Single arrow object (unlike other markers that have base + sides)
- Walking mode detection via
gameplay_walk.isWalking() - Objects registered with
canSave = falseto avoid persistence - Color lerping uses old/new mode transition over 0.3 seconds
See Also
- Race Marker: Crawl Marker - Arrow + Flag + Column Checkpoint - Related reference
- Race Marker: Cylinder - Base + Cylinder Checkpoint Marker - Related reference
- None Marker - Invisible Race Checkpoint Marker - Related reference
- Scenario System Guide - Guide