API ReferenceGE Extensionsflowgraphnodesvehicle
Vehicle Touch
- **Node Name:** `Vehicle Touch`
Overview
- Node Name:
Vehicle Touch - Category:
repeat_instant - File:
extensions/flowgraph/nodes/vehicle/touching.lua
Checks if a vehicle is colliding with another vehicle. If no second ID is given, checks for any vehicle-to-vehicle collision and reports up to 5 colliding vehicle IDs.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
flow | flow | Inflow for this node. |
vehIdA | number | ID of the vehicle to check collisions for. |
vehIdB | number | Optional: specific vehicle to check collision against. |
Output Pins
| Pin | Type | Description |
|---|---|---|
flow | flow | Always passes through. |
touching | flow | Active when a collision is detected. |
vehId1–vehId5 | number | IDs of colliding vehicles (sorted, hidden, -1 if none). |
touchingb | bool | True when collision detected (hidden). |
Internals
Key Methods
| Method | Description |
|---|---|
init() | No-op. |
work() | Reads map.objects[vehIdA].objectCollisions and checks for specific or any collision. |
How It Works
- Looks up vehicle A in
map.objectsand reads itsobjectCollisionstable. - Specific check: If
vehIdBis provided, checks if that ID exists in the collision table. - Any check: If no
vehIdB, collects all colliding IDs, sorts them, and outputs up to 5. - Sets
touchingflow andtouchingbbool if any collision is found.
Usage Example
-- Flowgraph:
-- [Player Vehicle] → vehIdA → [Vehicle Touch] → touching → [Penalty Logic]
-- ↓ vehId1
-- [Log Collision Partner]
-- Check collision in GE Lua:
local cols = map.objects[myVehId].objectCollisions
for otherId, _ in pairs(cols) do
print("Touching vehicle: " .. otherId)
endKey Dependencies
map.objects[id].objectCollisions- per-vehicle collision table maintained by the map system
Previously Undocumented (Added by Audit)
- Input Pin:
vehId2(any) - Input Pin:
vehId3(any) - Input Pin:
vehId4(any)
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