API ReferenceGE Extensionsflowgraphnodesvehicle
Toggle Vehicle Controls
- **Node Name:** `Toggle Vehicle Controls`
Overview
- Node Name:
Toggle Vehicle Controls - Category:
repeat_instant - File:
extensions/flowgraph/nodes/vehicle/toggleVehicleControls.lua
Enables or disables the player's ability to control vehicles by toggling the VehicleCommonActionMap.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
controllable | bool | Whether the vehicle should be controllable by the player. |
Internals
Key Methods
| Method | Description |
|---|---|
init() | No-op. |
work() | Finds VehicleCommonActionMap in the scene tree and sets its enabled state. |
_executionStopped() | Re-enables the action map to restore controls when the flowgraph stops. |
How It Works
- Looks up the
VehicleCommonActionMapobject in the scene tree. - Calls
setEnabled(controllable)to enable or disable all vehicle input bindings. - When flowgraph execution stops, automatically re-enables the action map as a safety measure.
⚠️ Known Issue: The
todofield notes thatPlayerUsablehas bugs and only works the first time.
Usage Example
-- Flowgraph:
-- [Cutscene Start] → flow → [Toggle Vehicle Controls (controllable=false)]
-- ...cutscene plays...
-- [Cutscene End] → flow → [Toggle Vehicle Controls (controllable=true)]
-- Equivalent GE Lua:
local actionMap = scenetree.findObject("VehicleCommonActionMap")
if actionMap then
actionMap:setEnabled(false) -- disable player vehicle controls
endKey Dependencies
scenetree.findObject("VehicleCommonActionMap")- the global vehicle input action map
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