Skip to main content

HSimpleVehicle

HELIX Vehicle information

💂Authority
This class can only be spawned on 🟦 Server side.
👪Inheritance
This class shares methods and events from Base Entity, Base Actor, Base Paintable, Damageable.

Constructor and Functions to use with the Vehicle Class.

Constructors

Default Constructor

local my_hsimplevehicle = HSimpleVehicle(location, rotation, blueprint_asset, collision_type?, gravity_enabled?)
TypeNameDefaultDescription
VectorlocationCoordenates to spawn a Vehicle
RotatorrotationAdditional rotation settings
Blueprint Referenceblueprint_assetA Simple Vehicle blueprint is required
CollisionTypecollision_typeCollisionType.Normal
booleangravity_enabledtrue

Static Functions

Inherited Entity Static Functions
Base Entityscripting-reference/classes/base-classes/Entity
ReturnsNameDescription
table of Base EntityGetAllReturns a table containing all Entities of the class this is called on
Base EntityGetByIndexReturns a specific Entity of this class at an index
integerGetCountReturns how many Entities of this class exist
iteratorGetPairsReturns an iterator with all Entities of this class to be used with pairs()
tableInheritInherits this class with the Inheriting System
table of tableGetInheritedClassesGets a list of all directly inherited classes from this Class created with the Inheriting System
table or nilGetParentClassGets the parent class if this Class was created with the Inheriting System
booleanIsChildOfGets if this Class is child of another class if this Class was created with the Inheriting System
functionSubscribeSubscribes to an Event for all entities of this Class
functionSubscribeRemoteSubscribes to a custom event called from server
UnsubscribeUnsubscribes all callbacks from this Event in this Class within this Package, or only the callback passed
This entity doesn't have own static functions.

Functions

Inherited Entity Functions
Base Entityscripting-reference/classes/base-classes/Entity
ReturnsNameDescription
integerGetIDGets the universal network ID of this Entity (same on both client and server)
tableGetClassGets the class of this entity
booleanIsARecursively checks if this entity is inherited from a Class
functionSubscribeSubscribes to an Event on this specific entity
functionSubscribeRemoteSubscribes to a custom event called from server on this specific entity
UnsubscribeUnsubscribes all callbacks from this Event in this Entity within this Package, or only the callback passed
SetValueSets a Value in this Entity
anyGetValueGets a Value stored on this Entity at the given key
DestroyDestroys this Entity
booleanIsValidReturns true if this Entity is valid (i.e. wasn't destroyed and points to a valid Entity)
CallRemoteEventCalls a custom remote event directly on this entity to a specific Player
CallRemoteEventCalls a custom remote event directly on this entity
BroadcastRemoteEventCalls a custom remote event directly on this entity to all Players
Inherited Actor Functions
Base Actorscripting-reference/classes/base-classes/Actor
ReturnsNameDescription
AddImpulseApplies a force in world world to this Actor
AttachToAttaches this Actor to any other Actor, optionally at a specific bone
DetachDetaches this Actor from AttachedTo Actor
SetCollisionSets this Actor's collision type
SetDimensionSets this Actor's Dimension
SetForceAdds a permanent force to this Actor, set to Vector(0, 0, 0) to cancel
SetGravityEnabledSets whether gravity is enabled on this Actor
SetVisibilitySets whether the actor is visible or not
SetHighlightEnabledSets whether the highlight is enabled on this Actor, and which highlight index to use
SetOutlineEnabledSets whether the outline is enabled on this Actor, and which outline index to use
SetLifeSpanSets the time (in seconds) before this Actor is destroyed. After this time has passed, the actor will be automatically destroyed.
SetLocationSets this Actor's location in the game world
SetRotationSets this Actor's rotation in the game world
SetRelativeLocationSets this Actor's relative location in local space (only if this actor is attached)
SetRelativeRotationSets this Actor's relative rotation in local space (only if this actor is attached)
SetScaleSets this Actor's scale
SetNetworkAuthoritySets the Player to have network authority over this Actor
SetNetworkAuthorityAutoDistributedSets if this Actor will auto distribute the network authority between players
TranslateToSmoothly moves this actor to a location over a certain time
RotateToSmoothly rotates this actor to an angle over a certain time
booleanIsBeingDestroyedReturns true if this Actor is being destroyed
booleanIsVisibleReturns true if this Actor is visible
booleanIsGravityEnabledReturns true if gravity is enabled on this Actor
booleanIsInWaterReturns true if this Actor is in water
booleanIsNetworkDistributedReturns true if this Actor is currently network distributed
table of Base ActorGetAttachedEntitiesGets all Actors attached to this Actor
Base Actor or nilGetAttachedToGets the Actor this Actor is attached to
tableGetBoundsGets this Actor's bounds
CollisionTypeGetCollisionGets this Actor's collision type
VectorGetLocationGets this Actor's location in the game world
VectorGetRelativeLocationGets this Actor's Relative Location if it's attached
Player or nilGetNetworkAuthorityGets this Actor's Network Authority Player
RotatorGetRotationGets this Actor's angle in the game world
RotatorGetRelativeRotationGets this Actor's Relative Rotation if it's attached
VectorGetForceGets this Actor's force (set by SetForce())
integerGetDimensionGets this Actor's dimension
booleanHasNetworkAuthorityReturns true if the local Player is currently the Network Authority of this Actor
booleanHasAuthorityGets if this Actor was spawned by the client side
VectorGetScaleGets this Actor's scale
VectorGetVelocityGets this Actor's current velocity
AddActorTagAdds an Unreal Actor Tag to this Actor
RemoveActorTagRemoves an Unreal Actor Tag from this Actor
table of stringGetActorTagsGets all Unreal Actor Tags on this Actor
booleanWasRecentlyRenderedGets if this Actor was recently rendered on screen
floatGetDistanceFromCameraGets the distance of this Actor from the Camera
floatGetScreenPercentageGets the percentage of this Actor size in the screen
Inherited Paintable Functions
Base Paintablescripting-reference/classes/base-classes/Paintable
ReturnsNameDescription
SetMaterialSets the material at the specified index of this Actor
SetMaterialFromCanvasSets the material at the specified index of this Actor to a Canvas object
SetMaterialFromSceneCaptureSets the material at the specified index of this Actor to a SceneCapture object
SetMaterialFromWebUISets the material at the specified index of this Actor to a WebUI object
ResetMaterialResets the material from the specified index to the original one
SetMaterialColorParameterSets a Color parameter in this Actor's material
SetMaterialScalarParameterSets a Scalar parameter in this Actor's material
SetMaterialTextureParameterSets a texture parameter in this Actor's material to an image on disk
SetMaterialVectorParameterSets a Vector parameter in this Actor's material
SetPhysicalMaterialOverrides this Actor's Physical Material with a new one
Inherited Damageable Functions
Base Damageablescripting-reference/classes/base-classes/Damageable
ReturnsNameDescription
integerApplyDamageDo damage to this entity
integerGetHealthGets the current health
integerGetMaxHealthGets the Max Health
RespawnRespawns the Entity, fullying it's Health and moving it to it's Initial Location
SetHealthSets the Health of this Entity
SetMaxHealthSets the MaxHealth of this Entity
ReturnsNameDescription
SetSirenSets the state of the siren (on/off) if available
SetHornSets the state of the horn (on/off) if available
SetDoorStateChanges the state of a selected door
SetIsDriftingEnables Vehicle's the drift state
SetHoodStateSets a state for the hood
SetTrunkStateSets a state for the trunk
SetWheelStateChange wheel's state
voidPrintDataDebug print data of the vehicle
SetVehicleHealthStateSets the Vehicle appearance into a state
SetAllowEnterExitFromInteractionThis prevents Vehicle enter/exit from player interaction
SetVehicleOwnerSets Vehicle ownership
SetOnlyOwnerCanInteractSets who can interact with the Vehicle
SetDrift_DriftLateralForceFrontPhysics calculation for the drift in Vehicle, lateral force front
SetDrift_DriftLateralForceRearPhysics calculation for the drift in Vehicle, lateral force rear
SetDrift_BaseLateralForceFrontPhysics calculation for the drift in Vehicle, lateral force front
SetDrift_BaseLateralForceRearPhysics calculation for the drift in Vehicle, lateral force rear
SetDrift_DriftTorquePhysics calculation for the drift in Vehicle, drift torque
SetDrift_BaseDriftTorquePhysics calculation for the drift in Vehicle, base drift torque
SetDrift_LowSpeedLateralForcePhysics calculation for the drift in Vehicle, low speed lateral force
SetTransmission_EfficiencyA simple scalar that affects only acceleration at any given gear
SetTransmission_ShiftDelayHow long do shifts (upshift/downshift) take in seconds.
SetTransmission_DifferentialRatioA number that shows how many times a Vehicle's engine driveshaft turns compared to its wheels
SetTransmission_UpshiftRatioRatio threshold of RPM to MaxRPM for an upshift to take place
SetTransmission_DownshiftRatioRatio threshold of RPM to MaxRPM for a downshift to take place
SetEngine_MaxTorqueThis is the maximum torque that the engine will produce
SetEngine_MaxRPMMaximum RPM
SetEngine_MaxReverseSpeedThis is the maximum speed (KPH) that can be achieved in reverse
SetEngine_BrakeForceBrake force in Newtons
SetEngine_BrakeCoefficientThis affects how quickly the RPM decreases when the throttle is not applied
SetAerodynamics_DragCoefficientSet the aerodynamics for the Vehicle
SetAerodynamics_CrossSectionAreaVehicle Area used for AirDrag calculation
SetWheelRadiusSet the physics wheel radius with a given float value
SetGearRatiosSet ratios between each gear change
integerNumOfAllowedPassangerReturns the number of doors the vehicle has
integerNumOfCurrentPassangerReturn the number of current passenger in the vehicle
integerGetVehicleSpeedReturns the speed of the vehicle in kilometers per hour
integerGetVehicleAccelerationReturns how fast the vehicle is accelerating
integerGetVehicleRPMReturns the current RPM
integerGetVehicleGearReturn the current gear index

SetSiren

Sets the state of the siren (on/off) if available

my_hsimplevehicle:SetSiren(bSiren)
TypeParameterDefaultDescription
booleanbSirenTrue parameter adds a siren with sound to a Vehicle

SetHorn

Sets the state of the horn (on/off) if available

my_hsimplevehicle:SetHorn(bHorn)
TypeParameterDefaultDescription
booleanbHorn

SetDoorState

Changes the state of a selected door

my_hsimplevehicle:SetDoorState(Doorindex, NewState, Curvetype)
TypeParameterDefaultDescription
integerDoorindexSet the door to manipulate
integerNewState0-Close, 1-Open 2-Broken
integerCurvetype0-Entering Vehicle curve, 1-Exiting Vehicle curve, 2-Normal

SetIsDrifting

Enables Vehicle's the drift state

my_hsimplevehicle:SetIsDrifting(bDrifting)
TypeParameterDefaultDescription
booleanbDriftingEnables drift state and returns to normal state after braking

SetHoodState

Sets a state for the hood

my_hsimplevehicle:SetHoodState(NewState, bForce)
TypeParameterDefaultDescription
integerNewStateStates: 0-Closed, 1-Open, 2-Broken
booleanbForcebForce=True is used at reconnecting to prevent spawning broken hood when syncing state

SetTrunkState

Sets a state for the trunk

my_hsimplevehicle:SetTrunkState(NewState, bForce)
TypeParameterDefaultDescription
integerNewStateStates: 0-Closed, 1-Open, 2-Broken
booleanbForcebForce=True is used at reconnecting to prevent spawning broken Trunk when syncing state

SetWheelState

Change wheel's state

my_hsimplevehicle:SetWheelState(Wheelindex, NewState)
TypeParameterDefaultDescription
integerWheelindexSet the tire to modify
integerNewStateStates: 0-Normal, 1-Flat, 2-Broken

PrintData

Debug print data of the vehicle

— Returns void (This Function is used to debug Vehicle variables in Server console log at once).

local ret = my_hsimplevehicle:PrintData()

SetVehicleHealthState

Sets the Vehicle appearance into a state

my_hsimplevehicle:SetVehicleHealthState(NewState?)
TypeParameterDefaultDescription
integerNewState? 0 State: 0-Normal, 1-Damaged, 2-Burning, 3-Broken

SetAllowEnterExitFromInteraction

This prevents Vehicle enter/exit from player interaction

my_hsimplevehicle:SetAllowEnterExitFromInteraction(NewAllowEnterExit?)
TypeParameterDefaultDescription
booleanNewAllowEnterExit?TrueTrue allows enter/exit from vehicle

SetVehicleOwner

Sets Vehicle ownership

my_hsimplevehicle:SetVehicleOwner(OwnerAccountID)
TypeParameterDefaultDescription
stringOwnerAccountIDThe scripter exposed function takes controller as input

SetOnlyOwnerCanInteract

Sets who can interact with the Vehicle

my_hsimplevehicle:SetOnlyOwnerCanInteract(NewOnlyOwnerCanInteract)
TypeParameterDefaultDescription
booleanNewOnlyOwnerCanInteractFirst set the Vehicle owner then use this function to set only owner can interact to true

SetDrift_DriftLateralForceFront

Physics calculation for the drift in Vehicle, lateral force front

my_hsimplevehicle:SetDrift_DriftLateralForceFront(DriftLateralForceFront)
TypeParameterDefaultDescription
integerDriftLateralForceFrontValues can be -32,768 to 32,767

SetDrift_DriftLateralForceRear

Physics calculation for the drift in Vehicle, lateral force rear

my_hsimplevehicle:SetDrift_DriftLateralForceRear(DriftLateralForceRear)
TypeParameterDefaultDescription
integerDriftLateralForceRearValues can be -32,768 to 32,767

SetDrift_BaseLateralForceFront

Physics calculation for the drift in Vehicle, lateral force front

my_hsimplevehicle:SetDrift_BaseLateralForceFront(BaseLateralForceFront)
TypeParameterDefaultDescription
integerBaseLateralForceFrontValues can be -32,768 to 32,767

SetDrift_BaseLateralForceRear

Physics calculation for the drift in Vehicle, lateral force rear

my_hsimplevehicle:SetDrift_BaseLateralForceRear(BaseLateralForceRear)
TypeParameterDefaultDescription
integerBaseLateralForceRearValues can be -32,768 to 32,767

SetDrift_DriftTorque

Physics calculation for the drift in Vehicle, drift torque

my_hsimplevehicle:SetDrift_DriftTorque(DriftTorque)
TypeParameterDefaultDescription
integerDriftTorqueValues can be -32,768 to 32,767

SetDrift_BaseDriftTorque

Physics calculation for the drift in Vehicle, base drift torque

my_hsimplevehicle:SetDrift_BaseDriftTorque(BaseDriftTorque)
TypeParameterDefaultDescription
integerBaseDriftTorqueValues can be -32,768 to 32,767

SetDrift_LowSpeedLateralForce

Physics calculation for the drift in Vehicle, low speed lateral force

my_hsimplevehicle:SetDrift_LowSpeedLateralForce(LowSpeedLateralForce)
TypeParameterDefaultDescription
integerLowSpeedLateralForceValues can be -32,768 to 32,767

SetTransmission_Efficiency

A simple scalar that affects only acceleration at any given gear

my_hsimplevehicle:SetTransmission_Efficiency(TransmissionEfficiency)
TypeParameterDefaultDescription
floatTransmissionEfficiencyHigher values result in a higher efficiency which increases acceleration. This does not affect top speed.

SetTransmission_ShiftDelay

How long do shifts (upshift/downshift) take in seconds.

my_hsimplevehicle:SetTransmission_ShiftDelay(ShiftDelay)
TypeParameterDefaultDescription
floatShiftDelay

SetTransmission_DifferentialRatio

A number that shows how many times a Vehicle's engine driveshaft turns compared to its wheels

my_hsimplevehicle:SetTransmission_DifferentialRatio(DifferentialRatio)
TypeParameterDefaultDescription
floatDifferentialRatio

SetTransmission_UpshiftRatio

Ratio threshold of RPM to MaxRPM for an upshift to take place

my_hsimplevehicle:SetTransmission_UpshiftRatio(UpshiftRatio)
TypeParameterDefaultDescription
floatUpshiftRatio

SetTransmission_DownshiftRatio

Ratio threshold of RPM to MaxRPM for a downshift to take place

my_hsimplevehicle:SetTransmission_DownshiftRatio(DownshiftRatio)
TypeParameterDefaultDescription
floatDownshiftRatioGear ratios should be spaced out such that an instance of intersection between an upshift and downshift ratio occurs

SetEngine_MaxTorque

This is the maximum torque that the engine will produce

my_hsimplevehicle:SetEngine_MaxTorque(MaxTorque)
TypeParameterDefaultDescription
integerMaxTorque

SetEngine_MaxRPM

Maximum RPM

my_hsimplevehicle:SetEngine_MaxRPM(MaxRPM)
TypeParameterDefaultDescription
integerMaxRPMRPM will not exceed this value unless an override is applied during runtime

SetEngine_MaxReverseSpeed

This is the maximum speed (KPH) that can be achieved in reverse

my_hsimplevehicle:SetEngine_MaxReverseSpeed(MaxReverseSpeed)
TypeParameterDefaultDescription
integerMaxReverseSpeed

SetEngine_BrakeForce

Brake force in Newtons

my_hsimplevehicle:SetEngine_BrakeForce(BrakeForce)
TypeParameterDefaultDescription
integerBrakeForce

SetEngine_BrakeCoefficient

This affects how quickly the RPM decreases when the throttle is not applied

my_hsimplevehicle:SetEngine_BrakeCoefficient(BrakeCoefficient)
TypeParameterDefaultDescription
floatBrakeCoefficientHigher values result in a quicker decrease. Lower values result in less off-throttle deceleration

SetAerodynamics_DragCoefficient

Set the aerodynamics for the Vehicle

my_hsimplevehicle:SetAerodynamics_DragCoefficient(DragCoefficient)
TypeParameterDefaultDescription
floatDragCoefficient

SetAerodynamics_CrossSectionArea

Vehicle Area used for AirDrag calculation

my_hsimplevehicle:SetAerodynamics_CrossSectionArea(CrossSectionArea)
TypeParameterDefaultDescription
floatCrossSectionArea

SetWheelRadius

Set the physics wheel radius with a given float value

my_hsimplevehicle:SetWheelRadius(Wheelindex, BaseTireRadius, FlatTireRadius)
TypeParameterDefaultDescription
integerWheelindex
floatBaseTireRadius
floatFlatTireRadius

SetGearRatios

Set ratios between each gear change

my_hsimplevehicle:SetGearRatios(GearsJson)
TypeParameterDefaultDescription
stringGearsJsonField name must be {"GearRatios": [3.5,2,1.535,1.21]}

NumOfAllowedPassanger

Returns the number of doors the vehicle has

— Returns integer.

local ret = my_hsimplevehicle:NumOfAllowedPassanger()

NumOfCurrentPassanger

Return the number of current passenger in the vehicle

— Returns integer.

local ret = my_hsimplevehicle:NumOfCurrentPassanger()

GetVehicleSpeed

Returns the speed of the vehicle in kilometers per hour

— Returns integer.

local ret = my_hsimplevehicle:GetVehicleSpeed()

GetVehicleAcceleration

Returns how fast the vehicle is accelerating

— Returns integer.

local ret = my_hsimplevehicle:GetVehicleAcceleration()

GetVehicleRPM

Returns the current RPM

— Returns integer.

local ret = my_hsimplevehicle:GetVehicleRPM()

GetVehicleGear

Return the current gear index

— Returns integer.

local ret = my_hsimplevehicle:GetVehicleGear()

Events

Inherited Entity Events
Base Entityscripting-reference/classes/base-classes/Entity
NameDescription
SpawnTriggered when an Entity is spawned/created
DestroyTriggered when an Entity is destroyed
ValueChangeTriggered when an Entity has a value changed with :SetValue()
ClassRegisterTriggered when a new Class is registered with the Inheriting System
Inherited Actor Events
Base Actorscripting-reference/classes/base-classes/Actor
NameDescription
SpawnTriggered when an Entity is spawned/created
DestroyTriggered when an Entity is destroyed
ValueChangeTriggered when an Entity has a value changed with :SetValue()
ClassRegisterTriggered when a new Class is registered with the Inheriting System
Inherited Damageable Events
Base Damageablescripting-reference/classes/base-classes/Damageable
NameDescription
SpawnTriggered when an Entity is spawned/created
DestroyTriggered when an Entity is destroyed
ValueChangeTriggered when an Entity has a value changed with :SetValue()
ClassRegisterTriggered when a new Class is registered with the Inheriting System
NameDescription
CharacterAttemptEnterTriggered when a character attempts to enters the Vehicle
CharacterEnterTriggered when a character fully enters the Vehicle
CharacterAttemptLeaveTriggered when a character attempts to exit the Vehicle
CharacterLeaveTriggered when a character fully exits the Vehicle
HornHorn sound emited from the Vehicle
SirenSiren sound emited from the Vehicle
TakeDamageEvent for the Vehicle taking damage
HitTriggered when a Vehicle is impacted from an external element

CharacterAttemptEnter

Triggered when a character attempts to enters the Vehicle
HSimpleVehicle.Subscribe("CharacterAttemptEnter", function(self, pawn, seat)
-- CharacterAttemptEnter was called
end)
TypeArgumentDescription
Vehicleself
Characterpawn
integerseatThe seat index

CharacterEnter

Triggered when a character fully enters the Vehicle
HSimpleVehicle.Subscribe("CharacterEnter", function(self, pawn, seat)
-- CharacterEnter was called
end)
TypeArgumentDescription
Vehicleself
Characterpawn
integerseatThe seat index

CharacterAttemptLeave

Triggered when a character attempts to exit the Vehicle
HSimpleVehicle.Subscribe("CharacterAttemptLeave", function(self, pawn)
-- CharacterAttemptLeave was called
end)
TypeArgumentDescription
Vehicleself
Characterpawn

CharacterLeave

Triggered when a character fully exits the Vehicle
HSimpleVehicle.Subscribe("CharacterLeave", function(self, pawn, seat)
-- CharacterLeave was called
end)
TypeArgumentDescription
Vehicleself
Characterpawn
integerseatThe seat index

Horn

Horn sound emited from the Vehicle
HSimpleVehicle.Subscribe("Horn", function(self, NewState)
-- Horn was called
end)
TypeArgumentDescription
Vehicleself
booleanNewState

Siren

Siren sound emited from the Vehicle
HSimpleVehicle.Subscribe("Siren", function(self, NewState)
-- Siren was called
end)
TypeArgumentDescription
Vehicleself
booleanNewState

TakeDamage

Event for the Vehicle taking damage
HSimpleVehicle.Subscribe("TakeDamage", function(self, Damage, BoneName, Type, HitFromDirection, Instigator, Causer)
-- TakeDamage was called
end)
TypeArgumentDescription
Vehicleself
integerDamage
stringBoneName
DamageTypeType
VectorHitFromDirection
PlayerInstigator
anyCauser

Hit

Triggered when a Vehicle is impacted from an external element
HSimpleVehicle.Subscribe("Hit", function(self, Intensity, NormalImpulse, ImpactLocation, _Velocity)
-- Hit was called
end)
TypeArgumentDescription
Vehicleself
floatIntensity
VectorNormalImpulse
VectorImpactLocation
Vector_Velocity