API ReferenceGE Extensionsflowgraphnodesvehicle
Move Vehicle To
- **Node Name:** `Move Vehicle To`
Overview
- Node Name:
Move Vehicle To - Category:
repeat_instant - File:
extensions/flowgraph/nodes/vehicle/moveTo.lua
Moves a vehicle to a predefined position and rotation. Supports both direct teleport (with repair) and safe teleport (finds a good spot automatically). Can optionally move without repairing the vehicle.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
vehId | number | ID of the vehicle to move. Defaults to player vehicle |
pos | vec3 | Target position |
rot | quat | Target rotation |
safeTeleport | bool | (hidden) Use safe teleport to find a good spot automatically |
repairVehicle | bool | (hidden, hardcoded) Whether to repair the vehicle when moved. Default: true |
Legacy Pins
| Old Name | New Name |
|---|---|
vehID | vehId |
Internals
Key Methods
| Method | Description |
|---|---|
work() | Calls resetVehicle() every frame |
resetVehicle() | Resolves the vehicle, validates position/rotation, and teleports with the appropriate method |
Teleport Modes
| repairVehicle | safeTeleport | Method Used |
|---|---|---|
| true (default) | false | vehicleSetPositionRotation() - direct teleport with repair |
| true | true | spawn.safeTeleport(veh, pos, rot) - safe teleport with repair |
| false | - | spawn.safeTeleport(veh, pos, rot, ..., false) - safe teleport without repair |
Rotation Correction
When using safeTeleport, the rotation is corrected: quat(rot) * quat(0,0,-1,0) to align the vehicle's forward direction properly.
How It Works
- Resolves the vehicle from
vehIdor defaults togetPlayerVehicle(0). - Validates that
posis a 3-element array. Falls back to{0,0,0,0}for rotation if not provided. - Depending on
repairVehicleandsafeTeleportflags:- Default (repair, no safe teleport): Uses
vehicleSetPositionRotation(id, x, y, z, rx, ry, rz, rw)- vehicle is repaired. - Repair + safe teleport: Uses
spawn.safeTeleport(veh, vec3(pos), quat(correctedRot)). - No repair: Uses
spawn.safeTeleportwith the last parameterfalseto skip repair.
- Default (repair, no safe teleport): Uses
- Fires appropriate hooks:
trackVehResetwhen repaired,onVehicleFlippedUprightwhen moved without repair.
Usage Example
-- In a flowgraph:
-- [Position Provider] → pos → [Move Vehicle To] ← vehId ← [Vehicle ID]
-- [Rotation Provider] → rot →
-- Programmatic equivalent (with repair):
vehicleSetPositionRotation(vehId, x, y, z, rx, ry, rz, rw)
extensions.hook('trackVehReset')
-- Without repair:
local correctedRot = quat(rot) * quat(0,0,-1,0)
spawn.safeTeleport(veh, vec3(pos), quat(correctedRot), nil, nil, nil, nil, false)
extensions.hook('onVehicleFlippedUpright', veh:getID())Key Dependencies
vehicleSetPositionRotation()- engine function for direct teleport with repairspawn.safeTeleport()- finds a safe position and teleports the vehicletrackVehResethook - fired when a vehicle is reset/repaired (used for DNF penalties)onVehicleFlippedUprighthook - fired when a vehicle is moved without repair
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