API ReferenceGE Extensionsflowgraphnodesvehicle
Set Vehicle Active
- **Node Name:** `Set Vehicle Active`
Overview
- Node Name:
Set Vehicle Active - Category:
once_instant - File:
extensions/flowgraph/nodes/vehicle/setActive.lua
Sets the active (visible/invisible) state of a vehicle. When inactive, the vehicle is hidden from the scene.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
vehId | number | ID of vehicle to set visibility for. If empty, uses player vehicle |
active | bool | Visibility state - true = visible, false = invisible |
Internals
Key Methods
| Method | Description |
|---|---|
workOnce() | Resolves vehicle and calls setActive() on it |
How It Works
- Looks up the vehicle by
vehIdusinggetObjectByID(), or falls back togetPlayerVehicle(0). - Calls
obj:setActive(1)to make the vehicle visible, orobj:setActive(0)to hide it. - The boolean pin value is converted to 1/0 via
self.pinIn.active.value and 1 or 0.
Usage Example
-- In a flowgraph - hide a vehicle:
-- [Vehicle ID] → [Set Vehicle Active].vehId
-- [Bool: false] → [Set Vehicle Active].active
-- Direct Lua equivalent:
local obj = getObjectByID(vehId)
obj:setActive(0) -- hide
obj:setActive(1) -- showKey Dependencies
getObjectByID()- resolves object by numeric IDgetPlayerVehicle(0)- gets the current player vehicleobj:setActive(int)- engine method to show (1) or hide (0) an object
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