API ReferenceGE Extensionsgameplaymarkers
Walking Marker
Reference for the walking marker class used by the POI/marker system to display interactive door icons when the player is on foot near buildings.
Reference for the walking marker class used by the POI/marker system to display interactive door icons when the player is on foot near buildings.
Module Exports
| Export | Description |
|---|---|
create(...) | Creates a new walkingMarker instance (class C) |
cluster(pois, allClusters) | Groups POIs by shared door/icon object names into clusters |
Class C - Instance Methods
| Method | Signature | Description |
|---|---|---|
init | C:init() | Sets self.visible = true |
setup | C:setup(cluster) | Configures door areas, icons, screen objects from cluster data |
update | C:update(data) | Per-frame update: OBB overlap checks, icon alpha/position smoothing, screen toggling |
createObjects | C:createObjects() | Creates/finds the BeamNGWorldIconsRenderer singleton |
clearObjects | C:clearObjects() | Removes all icons from the renderer and hides screens |
hide | C:hide() | Hides all door icons and screens |
show | C:show() | Re-shows the marker |
interactInPlayMode | C:interactInPlayMode(interactData, interactableElements) | If overlapping, adds cluster elements to interactable list |
instantFade | C:instantFade(visible) | No-op placeholder |
drawAxisBox | C:drawAxisBox(corner, x, y, z, clr) | Debug: draws an OBB using triangles |
drawOnMinimap | C:drawOnMinimap(td) | Draws simple circles on minimap for each door |
Internals
- Icon Renderer: Uses a shared
BeamNGWorldIconsRenderernamed"markerIconRenderer"with an icon atlas - Door Data: Each door has an OBB area (pos + x/y/z half-axes), an icon position, temporal smoothers for icon lift and alpha, and an optional screen object
- Overlap Detection: Uses
overlapsOBB_OBB()between the player walking bounding box and the door's area OBB - Icon Behavior: Icons lift upward when the player overlaps the area; alpha fades based on distance (
maxVisibleDistance) and raycasting for line-of-sight - Screen Objects: Tied to doors, shown for 5 seconds after overlap, hidden otherwise; play an audio cue on first overlap
How It Works
-- Clustering: POIs sharing the same door area+icon objects are merged
local function cluster(pois, allClusters)
-- Groups by sorted concatenation of area+icon names
-- Each cluster gets: doors, icon, iconLift, iconOffsetHeight, screens, elemData
end
-- Per-frame update flow:
function C:update(data)
-- For each door:
-- 1. Check OBB overlap with player walking bbox
-- 2. Play audio on first overlap if screen exists
-- 3. Show/hide screen objects (5s timer)
-- 4. Smooth icon position (lift on overlap) and alpha (fade by distance + raycast)
-- 5. Draw connecting line when lifted
-- Track anyOverlap for interaction state changes ("in"/"out")
endKey Constants
| Constant | Value | Purpose |
|---|---|---|
maxVisibleDistance | 15 | Max distance for icon visibility |
iconWorldSize | 20 | World-space icon size |
iconHeightBottom | 1.25 | Default lower icon height |
iconHeightTop | 2.5 | Default upper icon height |
iconOffsetHeight | 1.45 | Default icon offset above ground |
iconLift | 0.25 | Default lift amount on overlap |
See Also
- Big Map Marker - Related reference
- Crawl Marker - Related reference
- Drift Line Marker - Related reference
- Gameplay Systems Guide - Guide
Parking Marker
Marker class for parking spot interactions. Renders a floating icon, a ground stripe decal, and a 3D outline mesh. Detects vehicle-to-parking OBB overlap with two modes (contained or overlap). Support
Zone Marker
Reference for the zone marker class that checks if a driven vehicle is inside a 2D polygon zone for POI interactions.