Invisible Trigger
Invisible sphere-based trigger marker. Has no visual representation but detects when the player vehicle enters or exits a radius, firing `onEnter` and `onInside` callbacks. Used for gameplay triggers
Invisible sphere-based trigger marker. Has no visual representation but detects when the player vehicle enters or exits a radius, firing onEnter and onInside callbacks. Used for gameplay triggers without visible markers.
Class Methods
| Method | Signature | Description |
|---|---|---|
C:init | () | No-op |
C:setup | (cluster) | Stores position, radius, and onEnter/onInside callbacks |
C:update | (data) | Debug-only (commented out sphere/distance drawing) |
C:interactInPlayMode | (interactData, elements) | No-op |
C:interactWhileMoving | (interactData) | Checks squared distance; fires callbacks on enter/inside/exit |
C:createObjects | () | No-op |
C:setHidden | (value) | No-op |
C:show | () | No-op |
C:hide | () | Resets _inside to false |
C:clearObjects | () | No-op |
Module Functions
| Function | Signature | Returns | Description |
|---|---|---|---|
create | (...) | marker | Creates a new invisible trigger instance |
cluster | (pois, allClusters) | nil | One cluster per POI (no grouping) |
Internals
Trigger Detection
Runs in interactWhileMoving (called every frame while driving, not just at parking speed):
if vehPos:squaredDistance(self.pos) <= self.radius * self.radius then
if not self._inside then
self.onEnter(interactData) -- fires once on entry
end
self.onInside(interactData) -- fires every frame while inside
self._inside = true
else
if self._inside then
self.onExit(interactData) -- fires once on exit (only via hide())
end
self._inside = false
end- Walking mode is excluded (
if interactData.isWalking then return end) onEnterfires once when transitioning from outside to insideonInsidefires every frame while the vehicle is within radius- Exit is detected when distance exceeds radius
Cluster Data
{
id = 'invisibleTrigger#'..poi.id,
pos = vec3,
radius = number,
onEnter = function(interactData),
onInside = function(interactData),
visibilityPos = pos,
visibilityRadius = 0,
}How It Works
- POI system defines trigger positions with radius and callback functions
- Each frame while driving: squared-distance check against radius
- State transitions fire
onEnter(once) or trackonInside(continuous) - No visual rendering - purely logic-driven
See Also
- Big Map Marker - Related reference
- Crawl Marker - Related reference
- Drift Line Marker - Related reference
- Gameplay Systems Guide - Guide
Invisible Marker
Minimal no-op marker class. Has no visual representation or interaction behavior. Used as a placeholder or base marker when no visual or interaction is needed.
Mission Marker
Primary marker class for mission POIs. Renders floating icons with distance-based height, ground decals (dot + ring), line-of-sight alpha fading, and OBB-based player area detection. Supports smart cl