RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Bus DriverDamage GoalDemolition DerbyDistance GoalDrift GoalFinish Race GoalNo-Move GoalPosition GoalQuick RaceQuick Race LoaderRace MarkersRace DebugRace Goals ManagerRace UIScenario HelperScenario EngineScenarios LoaderSpeed GoalTime Limit GoalWaypoint ActionScenario Waypoints

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 Extensionsscenario

Position Goal

A scenario goal that checks if a vehicle is within range of a target scene object at race end. Used for parking/braking scenarios.

A scenario goal that checks if a vehicle is within range of a target scene object at race end. Used for parking/braking scenarios.


Internal State

FieldTypeDescription
M.instancesvariesAssigned as {}

Public API

FunctionSignatureDescription
M.init(scenario)Parses position goals from scenario JSON
M.processState(scenario, state, stateData)Checks distance to endpoint on race result
M.updateFinalStatus(scenario, instance)Reports final goal status to statistics system

Goal JSON Schema

{
  "goal": {
    "position": {
      "endPoint": "brake_zone_marker",
      "purpose": "fail",
      "msg": "scenarios.braking.notInZone"
    }
  }
}
FieldTypeDefaultDescription
endPointstringrequiredName of scene tree object to check distance to
purposestring"fail""fail" or "win" - result if outside range
msglocalizedString"Not in brake area"Message on trigger

How It Works

  1. init collects all goals with id == "position", validates and defaults purpose
  2. On onRaceResult:
    • Finds the endPoint object in the scene tree
    • Calculates distance between vehicle and endpoint
    • If distance > endobj.scale.x (uses X scale as radius):
      • Triggers win or fail based on purpose
    • Otherwise: sets result = "passed"

Usage Examples

-- Braking scenario: must stop within the marked zone
{
  "vehicles": {
    "scenario_player0": {
      "goal": {
        "position": {
          "endPoint": "brake_target",
          "purpose": "fail",
          "msg": "scenarios.braking.missedTarget"
        }
      }
    }
  }
}

Key Notes

  • Distance threshold uses the endpoint object's scale.x as the acceptance radius
  • Only checked at onRaceResult - not continuous monitoring
  • The endpoint must exist in the scene tree (scenetree.findObject)
  • For continuous position monitoring, use distance goal instead
  • Time string is appended to win messages but not fail messages

See Also

  • Scenario Bus Driver - Bus Route Scenario Logic - Related reference
  • Scenario Damage Goal - Damage-Based Win/Fail Condition - Related reference
  • Scenario Demolition Derby - Last Vehicle Moving Wins - Related reference
  • Scenario System Guide - Guide

No-Move Goal

A scenario goal that fails if a vehicle moves from its starting position. Used for parking/brake scenarios where a vehicle must remain stationary.

Quick Race

Handles the runtime logic for quick race scenarios: vehicle spawning, prefab loading, waypoint generation from race paths, lap timing, highscore recording, and time-of-day setup.

On this page

Internal StatePublic APIGoal JSON SchemaHow It WorksUsage ExamplesKey NotesSee Also