Drift Line Marker
Marker class for freeroam drift start lines. Shows/hides scene objects that form the visual start line. Detects when the player drives through the line to trigger a drift challenge.
Marker class for freeroam drift start lines. Shows/hides scene objects that form the visual start line. Detects when the player drives through the line to trigger a drift challenge.
Class Methods
| Method | Signature | Description |
|---|---|---|
C:init | () | Assigns unique id |
C:setup | (cluster) | Sets position, direction, radius, line id; shows marker objects from scene |
C:createObjects | () | No-op (uses scene objects) |
C:clearObjects | () | Hides all markerObjects in the scene tree |
C:hide | () | No-op |
C:show | () | No-op |
C:update | () | No-op |
C:interactWhileMoving | (interactData) | Detects if vehicle is inside the circle; triggers gameplay_drift_freeroam_driftSpots.detectStart(lineId) |
C:drawOnMinimap | (td) | Draws line between left/right endpoints (or circle if no direction) |
Module Functions
| Function | Signature | Returns | Description |
|---|---|---|---|
create | (...) | marker | Creates a new drift line marker instance |
cluster | (pois, allClusters) | nil | Creates one cluster per POI (no grouping) |
Internals
Detection
Simple squared-distance check: vehPos:squaredDistance(pos) <= radius². Only checks while driving (not walking). On detection, calls gameplay_drift_freeroam_driftSpots.detectStart(lineId).
Visual Line
The left/right endpoints are computed from the startDir:
local left = vec3(startDir.y, -startDir.x, 0):normalized()
self.left = pos + left * radius * 0.7
self.right = pos - left * radius * 0.7Marker Objects
Scene objects listed in cluster.markerObjects are shown on setup and hidden on clear. These are pre-placed objects in the level (e.g. road markings).
Clustering
Each POI becomes its own cluster - drift line markers are never grouped.
How It Works
- Level POI system provides drift line positions with start directions
- On setup, scene objects become visible
- Each frame while driving: checks if player is within radius
- On detection: notifies drift freeroam system to potentially start a drift challenge
See Also
- Big Map Marker - Related reference
- Crawl Marker - Related reference
- Gas Station Marker - Related reference
- Gameplay Systems Guide - Guide
Crawl Marker
Marker class for rock-crawling activity zones. Renders a floating icon at a configurable position, detects sphere-overlap with the vehicle bounding box, and supports activity interaction prompts.
Gas Station Marker
Marker class for gas station / charging station pump areas. Renders floating fuel/charge icons at each pump, detects OBB overlap with the vehicle, and supports interaction prompts for refueling.