RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Gameplay AchievementGameplay CityDiscoverForce FieldGarage ModeMarker InteractionParking SystemGameplay Playmode MarkersGameplay PoliceGameplay RallyGameplay Rally LoopGameplay Raw POIsGameplay Skidpad TestSpeed Trap LeaderboardsSpeed Traps and CamerasGameplay StatisticsTaxi Ride SystemTraffic SystemVehicle PerformanceWalking
Big Map MarkerCrawl MarkerDrift Line MarkerGas Station MarkerInspect Vehicle MarkerInvisible MarkerInvisible TriggerMission MarkerParking MarkerWalking MarkerZone Marker

UI

Resources

BeamNG Game Engine Lua Cheat SheetGE Developer RecipesMCP Server Setup

// RLS.STUDIOS=true

Premium Mods for BeamNG.drive. Career systems, custom vehicles, and immersive gameplay experiences.

Index

HomeProjectsPatreon

Socials

DiscordPatreon (RLS)Patreon (Vehicles)

© 2026 RLS Studios. All rights reserved.

Modding since 2024

API ReferenceGE Extensionsgameplaymarkers

Zone Marker

Reference for the zone marker class that checks if a driven vehicle is inside a 2D polygon zone for POI interactions.

Reference for the zone marker class that checks if a driven vehicle is inside a 2D polygon zone for POI interactions.


Module Exports

ExportDescription
create(...)Creates a new zoneMarker instance (class C)
cluster(pois, allClusters)Creates one cluster per POI (zone markers are NOT grouped/merged)

Class C - Instance Methods

MethodSignatureDescription
initC:init()No-op
setupC:setup(cluster)Stores zone polygons, visibility pos/radius
updateC:update(data)No-op
setHiddenC:setHidden(value)No-op
createObjectsC:createObjects()No-op
hide / showC:hide() / C:show()No-op
instantFadeC:instantFade(visible)No-op
clearObjectsC:clearObjects()No-op
interactInPlayModeC:interactInPlayMode(interactData, interactableElements)Checks if vehicle is inside any zone polygon and adds elements

Internals

  • Zone Check: Only active when not walking. Uses a quick radius pre-check (vehPos2d:distance(self.pos2d) <= self.radius+2), then tests 4 bounding box corner points against each zone polygon via containsPoint2D()
  • No Clustering: Unlike walkingMarker, each POI creates its own cluster - zones are independent
  • No Visual Elements: This marker type has no icons, renderers, or screen objects - it only provides interaction detection

How It Works

-- Interaction check (vehicle only, not walking):
function C:interactInPlayMode(interactData, interactableElements)
  if interactData.isWalking then return end
  -- Quick distance pre-check
  if interactData.vehPos2d:distance(self.pos2d) <= self.radius+2 then
    for _, z in ipairs(self.zones) do
      -- Check if all 4 bbox corners are inside the polygon
      if z:containsPoint2D(interactData.bbPoints[1])
        and z:containsPoint2D(interactData.bbPoints[4])
        and z:containsPoint2D(interactData.bbPoints[5])
        and z:containsPoint2D(interactData.bbPoints[8]) then
        -- Vehicle is inside zone - add all cluster elements
        for _, elem in ipairs(self.cluster.elemData) do
          table.insert(interactableElements, elem)
        end
      end
    end
  end
end

-- Clustering creates one cluster per POI:
local function cluster(pois, allClusters)
  for _, poi in ipairs(pois) do
    table.insert(allClusters, {
      id = 'zoneMarker#'..poi.id,
      zones = poi.markerInfo.zoneMarker.zones,
      visibilityPos = poi.markerInfo.zoneMarker.pos,
      visibilityRadius = poi.markerInfo.zoneMarker.radius,
      elemData = {poi.data},
      create = create,
    })
  end
end

Key Differences from walkingMarker

FeaturewalkingMarkerzoneMarker
Input modeWalking onlyVehicle only
DetectionOBB-OBB overlap2D polygon containment
Visual feedbackIcons, screensNone
ClusteringMerged by shared objectsOne per POI

See Also

  • Big Map Marker - Related reference
  • Crawl Marker - Related reference
  • Drift Line Marker - Related reference
  • Gameplay Systems Guide - Guide

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.

Locations Detector

Reference for `gameplay_missions_locationsDetector`, which detects missions near the player by checking clustered POI locations.

On this page

Module ExportsClass C - Instance MethodsInternalsHow It WorksKey Differences from walkingMarkerSee Also