API ReferenceGE Extensionsflowgraphnodesvehicle
Enter Vehicle
- **Node Name:** `Enter Vehicle`
Overview
- Node Name:
Enter Vehicle - Category:
dynamic_instant - File:
extensions/flowgraph/nodes/vehicle/enterVehicle.lua
Makes the player enter a vehicle and sets the camera to the game camera. Works with the walk mode system (gameplay_walk) to transition from on-foot to in-vehicle.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
vehId | number | ID of the vehicle to enter. If not provided, uses the player vehicle |
Legacy Pins
| Old Name | New Name |
|---|---|
vehID | vehId |
Internals
Key Methods
| Method | Description |
|---|---|
workOnce() | Calls enterVehicle() once on first trigger |
work() | In repeat dynamic mode, calls enterVehicle() every frame |
enterVehicle() | Resolves the vehicle, calls gameplay_walk.getInVehicle(), then commands.setGameCamera() |
How It Works
- The node resolves the target vehicle from
vehIdpin or defaults togetPlayerVehicle(0). - If a valid vehicle is found, it calls
gameplay_walk.getInVehicle(veh)to handle the enter-vehicle transition (including exiting walk mode if active). - After entering,
commands.setGameCamera()switches to the standard game camera (orbit/chase). - Supports
dynamic_instantcategory - can run once or repeat based on the node's dynamic mode setting.
Usage Example
-- In a flowgraph:
-- [Spawn Vehicle] → vehId → [Enter Vehicle] → [Continue]
-- Programmatic equivalent:
local veh = scenetree.findObjectById(vehId)
if veh then
gameplay_walk.getInVehicle(veh)
commands.setGameCamera()
endKey Dependencies
gameplay_walk.getInVehicle()- handles the player entering a vehicle from walk modecommands.setGameCamera()- switches to the default game cameragameplay_walk- listed as a dependency; must be loaded
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