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
Sites Custom FieldsSites LocationSites Parking SpotSites ContainerSites ManagerSites Zone

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 Extensionsgameplaysites

Sites Parking Spot

Class representing an oriented 3D parking box. Supports multi-spot generation (rows of spots), vehicle parking validation, and safe vehicle teleportation.

Class representing an oriented 3D parking box. Supports multi-spot generation (rows of spots), vehicle parking validation, and safe vehicle teleportation.


Constructor

local ParkingSpot = require('gameplay/sites/parkingSpot')
local spot = ParkingSpot(sites, name, forceId)

Methods

MethodSignatureReturnsDescription
set(pos, rot, scl)nilSet position, rotation, scale
calcVerts()nilRecalculate 2D corner vertices
containsPoint(pos)boolCheck if point is inside box
checkParking(vehId, precision, drivingSpd, parkingSpd)valid, resCheck if vehicle is correctly parked
vehicleFits(vehId)boolCheck if vehicle dimensions fit spot
boxFits(x, y, z)boolCheck if extents fit spot
hasAnyVehicles(playerId)hasVeh, vehIdsCheck for vehicles occupying spot
generateMultiSpots(parkingSpotList)nilGenerate additional spots in a row
moveResetVehicleTo(vehId, lowPrec, backwards, offsetPos, offsetRot, safeTele, removeTraf, resetVeh, opts)pos, rotTeleport vehicle to this spot
drawDebug(drawMode, clr)nilDraw oriented box visualization
getPath()stringSites file path reference
onSerialize / onDeserialized--JSON persistence

Fields

FieldTypeDescription
posvec3Center position
rotquatOrientation
sclvec3Dimensions (width, length, height)
isMultiSpotboolMulti-spot generator flag
multiSpotDatatable{spotAmount, spotOffset, spotDirection, spotRotation}
customFieldsCustomFieldsTags and typed fields

How It Works

Parking Validation (checkParking)

  1. Checks vehicle speed ≤ drivingSpeed (5 m/s default)
  2. Gets vehicle OOBB corners based on facing direction
  3. Scales corners by precision factor toward center
  4. Validates each corner is inside the parking box
  5. Final check: speed ≤ parkingSpeed (1 m/s)

Multi-Spot Generation

Generates additional spots offset in a direction (Left/Right/Front/Back) with optional rotation:

spot.isMultiSpot = true
spot.multiSpotData = { spotAmount = 4, spotOffset = 0.5, spotDirection = "Left", spotRotation = 0 }

Vehicle Teleportation (moveResetVehicleTo)

Supports two modes:

  • Safe teleport: Uses spawn.safeTeleport with traffic clearing
  • Precise placement: Computes exact position from OOBB corner alignment
-- Check if vehicle is parked
local valid, corners = spot:checkParking(vehId, 0.8)

-- Teleport vehicle to spot
spot:moveResetVehicleTo(vehId, false, false, nil, nil, true, true, true)

Dependencies

  • gameplay/sites/customFields - custom fields
  • spawn - safeTeleport
  • be - OOBB axis/center queries
  • map.objects - vehicle tracking data
FunctionSignatureReturnsDescription
M.init(sites, name, forceId)nilinit
M.drawSide(a, b, z, clrI)nildrawSide
M.setToVehicle(vehId)nilsetToVehicle

See Also

  • Sites Custom Fields - Related reference
  • Sites Location - Related reference
  • Sites Container - Related reference
  • Gameplay Systems Guide - Guide

Sites Location

Class representing a named point location within the sites system. Has a position, radius, color, and custom fields. Used for marking points of interest within zones.

Sites Container

Class that holds all site data for a level: locations, zones, and parking spots. Provides spatial queries via KD-trees and manages relationships between zones and their contained objects.

On this page

ConstructorMethodsFieldsHow It WorksParking Validation (checkParking)Multi-Spot GenerationVehicle Teleportation (moveResetVehicleTo)DependenciesSee Also