API ReferenceGE Extensionsflowgraphnodesvehicle
Track Vehicle
- **Node Name:** `Track Vehicle`
Overview
- Node Name:
Track Vehicle - Category:
repeat_instant - File:
extensions/flowgraph/nodes/vehicle/trackVehicle.lua
Registers a vehicle that was spawned outside the flowgraph so that the flowgraph's vehicle module can manage it.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
flow | flow | Inflow for this node. |
vehId | number | Vehicle ID. Uses player vehicle if 0 or not present. |
dontDelete | bool | If true, the vehicle won't be deleted when the project stops (hidden, default true). |
Internals
Key Methods
| Method | Description |
|---|---|
init() | No-op. |
work() | Finds the vehicle by ID and adds it to the flowgraph's vehicle module via mgr.modules.vehicle:addVehicle(). |
_executionStopped() | No-op. |
How It Works
- Resolves the vehicle object from
scenetreeby its ID. - Calls
self.mgr.modules.vehicle:addVehicle(veh, opts)to register the vehicle with the flowgraph manager. - The
dontDeleteoption (default true) prevents the flowgraph from deleting the vehicle when the project stops - important for vehicles the player already owns.
Usage Example
-- Flowgraph:
-- [On Start] → flow → [Track Vehicle]
-- ↑ vehId ← [Player Vehicle ID]
-- ↑ dontDelete ← true
-- This allows subsequent flowgraph nodes to reference and manipulate
-- a vehicle that wasn't spawned by the flowgraph itself.
-- Equivalent GE Lua:
local veh = scenetree.findObjectById(vehId)
mgr.modules.vehicle:addVehicle(veh, {dontDelete = true})Key Dependencies
mgr.modules.vehicle:addVehicle()- flowgraph vehicle module registrationscenetree.findObjectById()- scene tree lookup
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