RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Flowgraph Base ModuleFlowgraph Base NodeFlowgraph Base State NodeFlowgraph Node BuilderFlowgraph GraphFlowgraph Group HelperFlowgraph LinkFlowgraph ManagerNew Node TemplateFlowgraph PinFlowgraph States ManagerFlowgraph UtilsFlowgraph Variable Storage
Align For CouplingApply Velocity to VehicleBoost VehicleSet Vehicle ColorsCustom Parts Config ProviderEnter VehicleFlip UprightFreeze VehicleGenerate License PlateGet Vehicle ActiveGet Electrics ValueGet GearboxmodeGet Powertrain DataGravity ForceDistance From GroundHas Coupler TagIs CoupledIs Player UsableKeep VehicleMove Vehicle ToOn Cannon FiredOn Vehicle DestroyedOn Vehicle ResetOn Vehicle SpawnedOn Vehicle SwitchedPlayer UsableRandom Config ProviderRecover In PlaceRemove VehicleTimeline ReplaySet Vehicle ActiveSet Gearbox ModeSet IgnitionSet License PlateSet LightbarSet LightsShift to Gear IndexSpawn VehicleVehicle StatesTeleport To Last RoadToggle Vehicle ControlsMove To ShowroomVehicle TouchProps TouchStatic Object TouchTrack VehicleTrailer Respawn ControlVehicle Config ProviderGet Vehicle DataGet Vehicle DataGet Vehicle BoundsVehicle PingGet Vehicle Wheel Center

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 Extensionsflowgraphnodesvehicle

Teleport To Last Road

- **Node Name:** `Teleport To Last Road`

Overview

  • Node Name: Teleport To Last Road
  • Category: repeat_instant
  • File: extensions/flowgraph/nodes/vehicle/teleportToLastRoad.lua

Teleports a vehicle back to the nearest road. Optionally resets the vehicle and faces it toward a destination.

Pin Schema

Input Pins

PinTypeDescription
vehIdnumberID of the vehicle to move. Falls back to player vehicle.
resetVehicleboolWhether to reset the vehicle when teleported.
destinationPosvec3Position the vehicle should face toward after teleporting.

Internals

Key Methods

MethodDescription
work()Calls resetVehicle() and passes flow through.
resetVehicle()Resolves the vehicle, calls spawn.teleportToLastRoad(), and fires the onVehicleTeleportedToLastRoad hook.

How It Works

  1. Resolves the vehicle by ID or defaults to the player vehicle.
  2. Calls spawn.teleportToLastRoad(veh, opts) with options for reset and destination facing.
  3. Fires the extension hook onVehicleTeleportedToLastRoad with the vehicle's ID, allowing other systems to react.

Usage Example

-- Flowgraph:
-- [Button Press] → flow → [Teleport To Last Road]
--                             ↑ vehId ← [Player Vehicle]
--                             ↑ resetVehicle ← true
--                             ↑ destinationPos ← [Next Checkpoint]

-- Equivalent GE Lua:
local veh = getPlayerVehicle(0)
spawn.teleportToLastRoad(veh, {resetVehicle = true, destinationPos = {100, 200, 30}})
extensions.hook('onVehicleTeleportedToLastRoad', veh:getID())

Key Dependencies

  • spawn.teleportToLastRoad() - core teleportation function
  • extensions.hook() - fires the onVehicleTeleportedToLastRoad event

See Also

  • Align for Coupling (Flowgraph Node) - Related reference
  • Apply Velocity to Vehicle (Flowgraph Node) - Related reference
  • Boost Vehicle (Flowgraph Node) - Related reference
  • FlowGraph Guide - Guide

Vehicle States

- **Node Name:** `Vehicle States`

Toggle Vehicle Controls

- **Node Name:** `Toggle Vehicle Controls`

On this page

OverviewPin SchemaInput PinsInternalsKey MethodsHow It WorksUsage ExampleKey DependenciesSee Also