API ReferenceGE Extensionsflowgraphnodesvehicle
Flip Upright
- **Node Name:** `Flip Upright`
Overview
- Node Name:
Flip Upright - Category:
repeat_instant - File:
extensions/flowgraph/nodes/vehicle/flipUpright.lua
Flips a vehicle upright without repairing it. Uses spawn.safeTeleport with the vehicle's current position and a corrected rotation derived from its direction vector.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
vehId | number | ID of the vehicle to flip. If not provided, uses the player vehicle |
Internals
Key Methods
| Method | Description |
|---|---|
work() | Calls resetVehicle() and forwards flow |
resetVehicle() | Resolves the vehicle, teleports it upright at its current position, fires onVehicleFlippedUpright hook |
How It Works
- The node resolves the vehicle from
vehIdor defaults togetPlayerVehicle(0). - It calls
spawn.safeTeleport(veh, veh:getPosition(), quatFromDir(veh:getDirectionVector()), nil, nil, nil, nil, false).- The position stays the same (current location).
- The rotation is rebuilt from the vehicle's forward direction vector, forcing it upright.
- The last
falseparameter means the vehicle is not repaired.
- Fires
extensions.hook('onVehicleFlippedUpright', veh:getID())so other systems can react.
Usage Example
-- In a flowgraph:
-- [Flip Condition] → [Flip Upright] ← vehId ← [Vehicle ID]
-- Programmatic equivalent:
local veh = getPlayerVehicle(0)
if veh then
spawn.safeTeleport(veh, veh:getPosition(), quatFromDir(veh:getDirectionVector()), nil, nil, nil, nil, false)
extensions.hook('onVehicleFlippedUpright', veh:getID())
endKey Dependencies
spawn.safeTeleport()- teleports a vehicle safely to a position/rotationquatFromDir()- creates an upright quaternion from a direction vectoronVehicleFlippedUprighthook - notifies other systems of the flip
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