API ReferenceGE Extensionsflowgraphnodesvehicle
Get Vehicle Active
- **Node Name:** `Get Vehicle Active`
Overview
- Node Name:
Get Vehicle Active - Category:
repeat_instant - File:
extensions/flowgraph/nodes/vehicle/getActive.lua
Gets the active (visibility) state of a vehicle. Active means the vehicle is visible and simulated; inactive means it is hidden.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
vehId | number | ID of vehicle to check. If not provided, uses the player vehicle |
Output Pins
| Pin | Type | Description |
|---|---|---|
true | flow | Active when vehicle is visible |
false | flow | Active when vehicle is invisible |
isActive | bool | The visibility state as a boolean |
Internals
Key Methods
| Method | Description |
|---|---|
work() | Resolves the vehicle object, calls obj:getActive(), and sets all three output pins accordingly |
How It Works
- Resolves the vehicle from
vehIdor defaults togetPlayerVehicle(0). - Calls
obj:getActive()on the scene object to get its visibility state. - Sets the
trueflow pin when visible,falseflow pin when invisible, andisActiveboolean pin with the raw state.
Usage Example
-- In a flowgraph:
-- [Get Vehicle Active] ← vehId ← [Vehicle ID]
-- → (true) → [Vehicle is visible branch]
-- → (false) → [Vehicle is hidden branch]
-- Programmatic equivalent:
local obj = getPlayerVehicle(0)
if obj then
local isActive = obj:getActive()
print("Vehicle visible:", isActive)
endKey Dependencies
obj:getActive()- scene object method returning visibility/active state
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