API ReferenceGE Extensionsflowgraphnodesscene
Get Player Vehicle ID (Flowgraph Node)
- **Node Name:** `Get Player Vehicle ID`
Overview
- Node Name:
Get Player Vehicle ID - Category:
provider - File:
extensions/flowgraph/nodes/scene/getPlayerVehicle.lua
Gets the numeric ID of the vehicle currently controlled by the player.
Pin Schema
Output Pins
| Pin | Type | Description |
|---|---|---|
vehId | number | Id of the vehicle the player currently controls (-1 if none) |
exist | bool | Whether the player has an active vehicle (hidden) |
Legacy Pin Mapping
| Old Name | New Name |
|---|---|
objID | vehId |
Behavior
work()- Each frame, queriesbe:getPlayerVehicleID(0). Outputs the ID or -1 if no vehicle exists. Setsexistto true if the ID is not -1.
Key Dependencies
be:getPlayerVehicleID(playerIndex)- Returns the player's current vehicle ID, or -1
How It Works
A provider node (no flow pins needed) that continuously outputs the player's vehicle ID. The exist output is a convenience boolean for branching logic. Returns -1 when no vehicle is spawned.
Example Usage
-- Wire vehId to any node that needs the player vehicle ID
-- Use exist output to guard against no-vehicle scenarios
-- Common pattern: wire to Get Object Field to read vehicle properties
-- Or wire to camera nodes that need a vehicle referenceAdditional Methods
C:init()
Initializes the node, setting up pins and default properties.
See Also
- Collection Marker (Flowgraph Node) - Related reference
- Custom Lua Command (Flowgraph Node) - Related reference
- Get Object Field (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide