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
| Pin | Type | Description |
|---|---|---|
vehId | number | ID of the vehicle to move. Falls back to player vehicle. |
resetVehicle | bool | Whether to reset the vehicle when teleported. |
destinationPos | vec3 | Position the vehicle should face toward after teleporting. |
Internals
Key Methods
| Method | Description |
|---|---|
work() | Calls resetVehicle() and passes flow through. |
resetVehicle() | Resolves the vehicle, calls spawn.teleportToLastRoad(), and fires the onVehicleTeleportedToLastRoad hook. |
How It Works
- Resolves the vehicle by ID or defaults to the player vehicle.
- Calls
spawn.teleportToLastRoad(veh, opts)with options for reset and destination facing. - Fires the extension hook
onVehicleTeleportedToLastRoadwith 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 functionextensions.hook()- fires theonVehicleTeleportedToLastRoadevent
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