Skip to content
HELIX is in Early Access Preview. Some features and documentation may be non-functional or out of date.

HVehicle

HVehicle constructor and functions. This allows you to spawn a vehicle actor in the world and perform logical actions through class methods. This class also provides getter methods, allowing you to obtain data relating to specific vehicle actors.

Example
local vehicle = HVehicle(
    UE.FVector(-7940, 3400, 150),
    UE.FRotator(0, 180, 0),
    '/abcca-dax-veh/PongaseraGt/Blueprint/BP_PongaseraGtVehicle.BP_PongaseraGtVehicle_C',
    'QueryAndPhysics',
    true
)

vehicle:SetFuel(1.0)

Constructor#

  • returns: table — HVehicle wrapper with .Object (vehicle actor) and .Movement (UModularMovementComponent)
local vehicle = HVehicle(
    Vector(0, 0, 0),
    Rotator(0, 0, 0),
    '/abcca-dax-veh/PongaseraGt/Blueprint/BP_PongaseraGtVehicle.BP_PongaseraGtVehicle_C',
    'QueryAndPhysics',
    true
)
Type Name Default Description
Vector Location The location to spawn the vehicle at.
Rotator Rotation The orentiation of the vehicle.
string BlueprintAsset Long package name for the vehicle BP, e.g. "/Game/Vehicles/BP_MyCar.BP_MyCar_C"
string CollisionType QueryAndPhysics One of "NoCollision", "QueryOnly", "PhysicsOnly", "QueryAndPhysics"
boolean GravityEnabled true Whether physics gravity is enabled

Functions#

SetThrottleInput#

Sets the throttle input for the vehicle.

  • value: number — throttle value, typically 0.0 or 1.0 (on/off)
Example
vehicle:SetThrottleInput(1.0) -- full throttle

SetSteeringInput#

Sets the steering input for the vehicle.

  • value: number — steering input in range -1.0 (full left) to 1.0 (full right)
Example
vehicle:SetSteeringInput(-0.5) -- steer left

SetBrakeInput#

Sets the brake input for the vehicle.

  • value: number — brake input in range 0.0 (no brake) to 1.0 (full brake)
Example
vehicle:SetBrakeInput(1.0) -- hard brake

SetHandBrakeInput#

Sets the handbrake state for the vehicle.

  • enabled: booleantrue to enable handbrake, false to release
Example
vehicle:SetHandBrakeInput(true)

Horn#

Sets the horn state for the vehicle.

  • state: booleantrue to honk, false to stop
Example
vehicle:Horn(true)

Engine Control#

HoldStarter#

Holds the engine starter for a specified duration.

  • startTime: number — time to hold the starter in seconds (default 0.0)
Example
vehicle:HoldStarter(0.5)

ReleaseStarter#

Releases the engine starter.

Example
vehicle:ReleaseStarter()

StopEngine#

Stops the engine.

Example
vehicle:StopEngine()

SetEngineHealth#

Sets the engine health.

  • health: number — engine health value in range 0.0 (destroyed) to 1.0 (full)
Example
vehicle:SetEngineHealth(0.75)

GetEngineHealth#

Gets the engine/vehicle health.

  • returns: number|nil — health in range 0.0 to 1.0, or nil if movement is missing
Example
local health = vehicle:GetEngineHealth() or 0.0

Fuel System#

AddFuel#

Adds fuel to the vehicle’s current fuel level.

  • amount: number — amount of fuel to add (use 0.01.0 scale)
Example
vehicle:AddFuel(0.1)

SetFuel#

Sets the fuel level of the vehicle.

  • amount: number — new fuel level in range 0.0 to 1.0
Example
vehicle:SetFuel(0.5)

GetFuelRatio#

Gets the current fuel ratio of the vehicle.

  • returns: number — fuel level in range 0.0 to 1.0 (defaults to 0.0 if missing)
Example
local fuel = vehicle:GetFuelRatio()

State Queries#

IsInReverse#

Returns if the vehicle is currently in reverse gear.

  • returns: booleantrue if in reverse, otherwise false
Example
if vehicle:IsInReverse() then
    -- show reverse icon
end

GetRPMRatio#

Gets the normalized engine RPM.

  • returns: number — RPM ratio between 0.0 and 1.0
Example
local rpm = vehicle:GetRPMRatio()

GetNumberOfWheels#

Returns the total number of wheels on the vehicle.

  • returns: integer — wheel count
Example
print("Wheels:", vehicle:GetNumberOfWheels())

GetNumberOfWheelsTouchingGround#

Returns how many wheels are currently touching the ground.

  • returns: integer — number of wheels on ground
Example
local grounded = vehicle:GetNumberOfWheelsTouchingGround()

GetNumberOfDriveWheelsTouchingGround#

Returns how many drive wheels are drive wheels and touching the ground.

  • returns: integer — number of drive wheels on ground
Example
local drivenGrounded = vehicle:GetNumberOfDriveWheelsTouchingGround()

GetMassPerWheel#

Returns the mass per wheel.

  • returns: number — mass per wheel
Example
local massPerWheel = vehicle:GetMassPerWheel()

IsBraking#

Returns whether the vehicle is currently braking.

  • returns: booleantrue if braking, otherwise false
Example
if vehicle:IsBraking() then
    -- brake lights logic
end

Sleep & Airborne#

SetCanSleep#

Controls whether the vehicle is allowed to go to sleep (physics idle).

  • enabled: booleantrue to allow sleeping, false to prevent
Example
vehicle:SetCanSleep(false)

SetSleeping#

Forces the vehicle into or out of sleeping state.

  • enabled: booleantrue to force sleeping, false to wake
Example
vehicle:SetSleeping(true)

ApplyAirbornePhysics#

Applies airborne physics behavior once (used when the vehicle is in the air).

Example
vehicle:ApplyAirbornePhysics()

Setup & Data Access#

GetSetup#

Returns the vehicle’s setup data.

  • returns: UModularVehicleData | nil — setup data or nil
Example
local setup = vehicle:GetSetup()

Debugging & Utilities#

GetWheels#

Returns the wheels on the vehicle.

  • returns: table — array-like table of UModularWheel objects
Example
local wheels = vehicle:GetWheels()

UpdateComponents#

Updates vehicle components with additional wheels.

  • additionalWheels: table — array-like table of UModularWheel objects to add
Example
vehicle:UpdateComponents(extraWheels)

AI & Navigation#

RequestDirectMove#

Requests a direct move towards a velocity (AI/navigation helper).

  • moveVelocity: Vector — desired movement velocity
  • forceMaxSpeed: booleantrue to force max speed, false to respect limits (default false)
Example
vehicle:RequestDirectMove(Vector(1000, 0, 0), false)

RequestPathMove#

Requests movement through a new move input vector (AI/navigation helper).

  • inputVector: Vector — movement input direction/magnitude
Example
vehicle:RequestPathMove(Vector(1, 0, 0))

StopActiveMovement#

Stops applying further movement (usually zeroes acceleration).

Example
vehicle:StopActiveMovement()

StopMovementKeepPathing#

Stops movement immediately but continues following the current navigation path.

Example
vehicle:StopMovementKeepPathing()

Replication & Cosmetic Sync#

SetCosmeticDataOnServer#

Sets replicated cosmetic data on the server.

  • data: FRepCosmeticData — cosmetic data struct
Example
vehicle:SetCosmeticDataOnServer(cosmeticData)

Extra Nav Movement Helpers#

IsFlying#

Whether the vehicle is considered flying.

  • returns: booleantrue if flying
Example
if vehicle:IsFlying() then
    -- airborne logic
end

IsFalling#

Whether the vehicle is falling.

  • returns: booleantrue if falling
Example
if vehicle:IsFalling() then
    -- falling logic
end

IsMovingOnGround#

Whether the vehicle is moving on the ground.

  • returns: booleantrue if moving on ground
Example
if vehicle:IsMovingOnGround() then
    -- traction logic
end

IsSwimming#

Whether the vehicle is swimming (moving through fluid).

  • returns: booleantrue if swimming
Example
if vehicle:IsSwimming() then
    -- water logic
end

IsCrouching#

Whether the nav movement considers the vehicle “crouching” (rare for vehicles, but exposed).

  • returns: booleantrue if crouching
Example
if vehicle:IsCrouching() then
    -- low-profile logic
end

GetVelocityForNavMovement#

Gets the current velocity used by nav movement.

  • returns: Vector — current nav velocity (defaults to Vector(0,0,0))
Example
local vel = vehicle:GetVelocityForNavMovement()

GetMaxSpeedForNavMovement#

Gets the maximum speed used for navigation.

  • returns: number — max nav speed
Example
local maxSpeed = vehicle:GetMaxSpeedForNavMovement()

Lights & Sirens#

SetRightIndicator#

Sets the right indicator/blinker state.

  • NewState: booleantrue to enable, false to disable
Example
vehicle:SetRightIndicator(true)

SetLeftIndicator#

Sets the left indicator/blinker state.

  • NewState: booleantrue to enable, false to disable
Example
vehicle:SetLeftIndicator(true)

SetReverseLight#

Sets the reverse light state.

  • NewState: booleantrue to enable, false to disable
Example
vehicle:SetReverseLight(true)

SetRedLightIntensity#

Sets the red light intensity (e.g. emergency light).

  • Value: number — red light intensity
Example
vehicle:SetRedLightIntensity(5.0)

SetLightsEmissiveStrength#

Sets overall light emissive strength.

  • Value: number — emissive strength
Example
vehicle:SetLightsEmissiveStrength(3.0)

SetIndicatorLightsIntensity#

Sets indicator light intensity.

  • Value: number — indicator light intensity
Example
vehicle:SetIndicatorLightsIntensity(4.0)

SetIndicatorAnimationSpeed#

Sets indicator blink animation speed.

  • Value: number — animation speed
Example
vehicle:SetIndicatorAnimationSpeed(1.5)

SetHazardLight#

Sets the hazard lights state.

  • NewState: booleantrue to enable hazards, false to disable
Example
vehicle:SetHazardLight(true)

SetBrakeLight#

Sets the brake light state manually.

  • NewState: booleantrue to enable, false to disable
Example
vehicle:SetBrakeLight(true)

SetSirenState#

Toggles the siren state if a siren component is present.

  • state: booleantrue to enable siren, false to disable
Example
vehicle:SetSirenState(true)

SetSirenEmissionStrength#

Sets siren light emission strength.

  • Amount: number — emission strength
Example
vehicle:SetSirenEmissionStrength(2.0)

SetSirenRedColor#

Sets the siren red color.

  • NewColor: LinearColor — new red color
Example
vehicle:SetSirenRedColor(LinearColor(1, 0, 0, 1))

SetSirenBlueColor#

Sets the siren blue color.

  • NewColor: LinearColor — new blue color
Example
vehicle:SetSirenBlueColor(LinearColor(0, 0, 1, 1))

SetSirenBaseColor#

Sets the siren base color.

  • NewColor: LinearColor — new base color
Example
vehicle:SetSirenBaseColor(LinearColor(1, 1, 1, 1))

SetSirenAnimationSpeed#

Sets the siren animation speed.

  • Speed: number — animation speed multiplier
Example
vehicle:SetSirenAnimationSpeed(1.2)