API ReferenceGE Extensionsflowgraphnodesvehicle
Recover In Place
- **Node Name:** `Recover In Place`
Overview
- Node Name:
Recover In Place - Category:
once_instant - File:
extensions/flowgraph/nodes/vehicle/recoverInPlace.lua
Recovers a vehicle in place - resets broken flex mesh and safely teleports the vehicle to its current position. The vehicle may be slightly repositioned to avoid intersecting obstacles.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
vehId | number | ID of vehicle to recover. If empty, uses player vehicle |
Legacy Pin Mapping
in.vehID→vehId
Internals
Key Methods
| Method | Description |
|---|---|
init() | Empty initialization |
workOnce() | Finds vehicle, resets broken flex mesh, and safe-teleports to current position |
How It Works
- Looks up the vehicle by
vehIdor falls back to the player vehicle (getPlayerVehicle(0)). - Calls
veh:resetBrokenFlexMesh()to repair any deformed mesh. - Calls
spawn.safeTeleport()with the vehicle's current position and orientation. safeTeleportadjusts the position slightly to avoid clipping into terrain/objects.
Usage Example
-- In a flowgraph - recover vehicle after a crash:
-- [Get Player Vehicle] → (vehId) → [Recover In Place]
-- Direct Lua equivalent:
local veh = getPlayerVehicle(0)
if veh then
veh:resetBrokenFlexMesh()
spawn.safeTeleport(veh, veh:getPosition(),
quatFromDir(veh:getDirectionVector(), veh:getDirectionVectorUp()))
endKey Dependencies
veh:resetBrokenFlexMesh()- repairs deformed vehicle meshspawn.safeTeleport(veh, pos, rot)- teleports vehicle to position while avoiding collisionsquatFromDir()- creates a quaternion from direction vectors
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