API ReferenceGE Extensionsflowgraphnodesvehicle
Player Usable
- **Node Name:** `Player Usable`
Overview
- Node Name:
Player Usable - Category:
repeat_instant - File:
extensions/flowgraph/nodes/vehicle/playerUsable.lua
Sets whether a vehicle can be controlled by the player. Useful for locking/unlocking vehicles during scenarios.
Known Issue:
PlayerUsablehas some bugs and only works the first time (per the sourcetodocomment).
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
vehId | number | ID of vehicle to set usability for |
controllable | bool | Whether the vehicle should be player-controllable |
Legacy Pin Mapping
in.vehiId→vehId
Internals
Key Methods
| Method | Description |
|---|---|
init() | Empty initialization |
work() | Looks up vehicle by ID via scenetree.findObjectById(), sets obj.playerUsable |
How It Works
- On each tick,
work()looks up the vehicle byvehIdusingscenetree.findObjectById(). - If no valid ID is provided (nil or 0), the node does nothing (player vehicle fallback is commented out).
- Sets the
playerUsableproperty on the vehicle's underlying object to thecontrollablepin value.
Usage Example
-- In a flowgraph - lock a vehicle so the player cannot control it:
-- [Get Vehicle ID] → (vehId) → [Player Usable].vehId
-- [Bool: false] → [Player Usable].controllable
-- Direct Lua equivalent:
local veh = scenetree.findObjectById(vehId)
veh.obj.playerUsable = false -- lock
veh.obj.playerUsable = true -- unlockKey Dependencies
scenetree.findObjectById()- resolves vehicle ID to scene objectobj.playerUsable- engine property controlling player input acceptance
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