Skip to content

VehicleAsset — Vehicle Definitions

VehicleAsset is the largest single asset class in Unturned at 2,809 lines. It defines every aspect of a vehicle: engine type, speed, acceleration, steering, fuel, battery, health, damage resistance, turrets, passenger seats, paint, cargo storage, wheel configuration, engine simulation with RPM and gears, bumper damage, explosion behavior, and network validation parameters. It extends Asset directly and uses the VEHICLE asset category rather than the ITEM category.

Source code location: Unturned/Bundles/VehicleAsset.cs

Inheritance Chain

Asset
  → ISkinableAsset  (interface)
  → IArmorFalloff    (interface)
    → VehicleAsset
    → VehiclePhysicsProfileAsset
    → VehicleRedirectorAsset

Engine Types

csharp
public enum EEngine { CAR, BOAT, HELICOPTER, PLANE, BLIMP, TRAIN }
PropertyCARBOATHELICOPTER/PLANETRAIN
Default physics profiledefaultProfile_CardefaultProfile_BoatdefaultProfile_Helicopter/PlaneNone
Fuel burn rate2.054.24.2
Valid speed up12.53.25100100
Valid speed down25.025.0100100
Default steering tires2111

Model Loading

Vehicle models are loaded via deferred asset references:

csharp
private IDeferredAsset<GameObject> clientModel;      // "Vehicle" prefab
private IDeferredAsset<GameObject> legacyServerModel; // "Clip" prefab (deprecated)

Load Order

  1. If on dedicated server and Has_Clip_Prefab is true, load "Clip" first. Fall back to client model.
  2. Otherwise, load "Vehicle" client model.

OnClientModelLoaded

When the client model loads:

  • Detects Headlights, Sirens, Hook child transforms.
  • Determines _pitchIdle and _pitchDrive from AudioSource clip name.
  • Runs AssetValidation and server-side component removal.
  • Validates the Seats transform and checks for root Rigidbody.
  • If no physicsProfileRef is set and root/wheel masses are 1.0, auto-assigns the default profile by engine type.
  • Recursively tags all children with "Vehicle" for hit detection.
  • If no wheelConfiguration is explicitly set, calls BuildAutomaticWheelConfiguration.

Speed and Acceleration

FieldTypeDescription
TargetReverseVelocityfloatMaximum reverse speed (negative value)
TargetForwardVelocityfloatMaximum forward speed, multiplied by 1.25 unless TRAIN
_brakefloatBrake torque
_liftfloatHelicopter/plane lift force
engineForceMultiplierfloatGlobal force multiplier (default 1.0)
airTurnResponsivenessfloatAir vehicle turn speed (default 2)
airSteerMinfloatAir steering at max speed
airSteerMaxfloatAir steering at zero speed

Steering System

FieldTypeDescription
MaxSteeringAngle (_steerMax)floatSteering angle at zero speed (deg)
MaxSteeringAngleAtFullSpeed (_steerMin)floatSteering angle at max speed (deg)
SteeringAngleTurnSpeedfloatSteering wheel rotation rate (deg/s)
CrawlerTrackSteeringTorquefloatDifferential torque for tank steering
CrawlerTrackSteeringSidewaysFrictionMultiplierfloatSide friction reduction during tank turns
CrawlerTrackSteeringMaxSpeedScalefloatSteering effectiveness at max speed

Steering angle is interpolated between MaxSteeringAngleAtFullSpeed and MaxSteeringAngle based on |speed| / |targetSpeed|. This provides tighter turning at low speeds while maintaining stability at high speeds.

Bicycle / Motorcycle Leaning

FieldTypeDescription
steeringLeaningForceMultiplierfloatRoll torque per steering input (default -1 = disabled)
steeringLeaningForceShouldScaleWithSpeedboolScale leaning force with speed
steeringLeaningForceSpeedExponentfloatSpeed exponent for scaling

Wheel Configuration

Each wheel has a detailed VehicleWheelConfiguration entry with fields for collider path, model path, power state, steering mode, motion effects, and explosion behavior.

Key Configuration Fields

FieldTypeDescription
wheelColliderPathstringHierarchy path to WheelCollider
isColliderPoweredboolWhether motor torque is applied
modelPathstringPath to visual wheel model
isModelSteeredboolWhether model rotates with steering
modelUseColliderPoseboolUse GetWorldPose for positioning
modelRadiusfloatVisual-only wheel radius (RPM calculation)
copyColliderRpmIndexintCopy RPM from another collider
copyCrawlerTrackSpeedIndexintCopy crawler track speed
steeringAngleMultiplierfloatPer-wheel steering multiplier (default 1.0)
modelSuspensionOffsetfloatVertical model offset for suspension
modelSuspensionSpeedfloatInterpolation speed
motionEffectsModeEWheelMotionEffectsModeParticle effects mode
canExplodeboolWheel flies off on explosion (default true)
steeringModeEWheelSteeringModeNone/SteeringAngle/CrawlerTrack
crawlerTrackForwardModeECrawlerTrackForwardModeTank track rotation direction

Automatic Configuration

If no WheelConfigurations list is provided, BuildAutomaticWheelConfiguration reconstructs the legacy layout:

  1. Tires transform → children Tire_N → each gets a configuration. First 2 wheels steer (CAR), last 2 are powered.
  2. Wheels transform → children matched to colliders by distance.
  3. Steering tire indices from steeringTireIndices are matched to models for isModelSteered.

RPM and Gear System

When ForwardGearRatios is specified, the vehicle uses simulated engine RPM with gear shifting:

FieldTypeDescription
reverseGearRatiofloatReverse gear multiplier (default 1.0)
forwardGearRatiosfloat[]Per-gear ratios
UsesEngineRpmAndGearsboolTrue if gear ratios array is non-empty
AllowsEngineRpmAndGearsInHudboolShow RPM/gear HUD (default true)

RPM Parameters

FieldDefaultDescription
EngineIdleRpm1000Minimum RPM at idle
EngineMaxRpm7000Redline RPM
EngineRpmIncreaseRate-1 (instant)RPM increase rate
EngineRpmDecreaseRate-1 (instant)RPM decrease rate
EngineMaxTorque1.0Torque curve multiplier

Gear Shifting

FieldDefaultDescription
GearShiftDownThresholdRpm1500RPM threshold to downshift
GearShiftUpThresholdRpm5500RPM threshold to upshift
GearShiftDuration0.5sThrottle disengagement during shift
GearShiftInterval1.0sMin time between gear changes
GearShiftAllowSkippingGearstrueAllow gear skipping

RPM Mismatch Handling

FieldDescription
EngineRpmMismatchTorqueReductionEnabledReduces torque when RPM mismatches wheel speed
EngineRpmMismatchTorqueReductionThresholdRPM difference threshold
EngineRpmMismatchGearShiftPreventShiftingBlocks gear shifts during mismatch

Required prefab component: EngineCurvesComponent for the torque curve (validated at asset load).

Fuel System

FieldTypeDefaultDescription
_fuelMin / _fuelMaxushortFuel spawn range
_fuelushortFull fuel capacity
fuelBurnRatefloat2.05 (CAR) / 4.2 (other)Fuel consumed per second

Battery System

FieldTypeDefaultDescription
canSpawnWithBatterybooltrueVehicle spawns with battery
batterySpawnChargeMultiplierfloat1.0Starting charge level
batteryBurnRatefloat20Drain per second (Burn mode)
batteryChargeRatefloat20Charge per second (Charge mode)
batteryDrivingEBatteryModeChargeMode while driving
batteryEmptyEBatteryModeNoneMode when depleted
batteryHeadlightsEBatteryModeBurnMode with headlights
batterySirensEBatteryModeBurnMode with sirens
csharp
public enum EBatteryMode { None, Burn, Charge }

Health and Damage

Vulnerability Flags

FieldDescription
isVulnerableTakes non-explosive damage
isVulnerableToExplosionsTakes explosive damage
isVulnerableToEnvironmentTakes environmental damage
isVulnerableToBumperTakes collision self-damage
canTiresBeDamagedTires can be shot out
CanDecayCan decay over time (false for TRAIN)

Bumper Damage

When the vehicle collides with an entity:

FieldTypeDefaultDescription
_bumperMultiplierfloat1.0Speed→damage multiplier
BumperSpeedDamageThresholdfloat3Minimum speed for damage
BumperPlayerDamagefloat10Player damage at 1 m/s
BumperZombieDamagefloat15Zombie damage at 1 m/s
BumperAnimalDamagefloat15Animal damage at 1 m/s
BumperObjectDamagefloat30Object damage at 1 m/s
BumperResourceDamagefloat85Resource damage at 1 m/s
BumperSelfDamageMultiplierfloat1Self-damage multiplier

Explosion

FieldTypeDescription
ExplosionEffectGuid / _explosionGuid + ushortExplosion effect
ShouldExplosionCauseDamageboolDamage nearby entities
ShouldExplosionBurnMaterialsboolBurn paintable sections
minExplosionForce / maxExplosionForceVector3Physics impulse range
passengerExplosionArmorfloatPassenger damage reduction (default 1.0)
childExplosionArmorMultiplierfloatPassenger armor multiplier (default 0.2)

Passenger and Turret System

Seats

Seats are discovered automatically from the Seats transform hierarchy. The seat count is calculated by counting Seat_N children of the Seats transform.

Turrets

csharp
public class TurretInfo
{
    public byte seatIndex;     // Which seat controls this turret
    public ushort itemID;      // The gun item ID for the turret weapon
    public float yawMin/Max;   // Horizontal rotation limits
    public float pitchMin/Max; // Vertical rotation limits
    public bool useAimCamera;  // Whether aiming zooms
}

Defined via indexed .dat keys:

  • Turret_N_Seat_Index — Which seat controls turret N.
  • Turret_N_Item_ID — The weapon item.
  • Turret_N_Yaw_Min/Max — Yaw rotation limits.
  • Turret_N_Pitch_Min/Max — Pitch rotation limits.
  • Turret_N_Ignore_Aim_Camera — Disable aim camera.

Cargo / Trunk

FieldTypeDescription
trunkStorage_X / trunkStorage_YbyteTrunk inventory grid size
dropsTableIdushortSpawn table for death drops
dropsMin / dropsMaxbyteDrop count range
tireIDushortCompatible tire item ID (default 1451)

Camera

FieldTypeDefaultDescription
_camFollowDistancefloat5.5Third-person camera distance
camDriverOffsetfloat0Driver vertical offset
camPassengerOffsetfloat0Passenger vertical offset

Network Validation

FieldDescription
_sqrDeltaMax horizontal movement per tick
validSpeedUpMax upward speed
validSpeedDownMax downward speed
ValidHitDistanceMultiplierHit position distance threshold
_exitExit distance from vehicle (default 2)

Buildable Placement

csharp
public enum EVehicleBuildablePlacementRule { None, AlwaysAllow, Block }

Controls barricade placement on the vehicle: follow barricade rules, always allow, or always block.

Paint System

FieldDescription
PaintableVehicleSectionsSections that can be repainted
SupportsPaintColorTrue if sections exist
IsPaintablePlayers can apply paint items
DefaultPaintColorsRandom color pool
defaultPaintColorModeList or RandomHueOrGrayscale
randomPaintColorConfigurationHSV ranges for random colors

Mechanical Fields

FieldDescription
staminaBoostStamina recovery bonus
isStaminaPoweredBicycle (powered by player stamina)
isBatteryPoweredRequires battery
isReclinedSporty car seating
hasTractionEnhanced traction control
hasSledsSnowmobile skis
hasZipZip line targeting
hasBicycleBicycle pedaling
canBeLockedLockable to group (default true)
canStealBatteryBattery removable by others (default true)
carjackForceMultiplierFlip force (default 1.0)
hasCenterOfMassOverrideCustom center of mass
centerOfMassCenter of mass position

Trains

FieldDescription
trainTrackOffsetTrack alignment offset
trainWheelOffsetWheel visual offset
trainCarLengthCar length for coupling

Wheel Balancing (Motorcycles)

FieldDefaultDescription
wheelBalancingForceMultiplier-1 (disabled)Roll torque for stability
wheelBalancingUprightExponent1.5Upright alignment curve
rollAngularVelocityDamping-1 (disabled)Roll damping

Engine Sound

Legacy Sound

Uses _pitchIdle and _pitchDrive computed from AudioSource clip name:

  • "Engine_Large" → pitchIdle 0.625, pitchDrive 0.025.
  • "Engine_Small" → pitchIdle 0.75, pitchDrive 0.075.
  • Default → pitchIdle 0.5, pitchDrive 0.05 (0.03 helicopter, 0.1 blimp).

RPM-Based Sound

When engineSoundType = EngineRPMSimple, uses RpmEngineSoundConfiguration with idle/max pitch and volume driven by current RPM.

Cargo Data Export

BuildCargoData writes to the Vehicle table and three child tables:

  • Vehicle_TurretInfo — Per-turret seat, item, yaw/pitch limits.
  • Vehicle_DefaultPaintColors — Color list.
  • Vehicle_VehicleRandomPaintColorConfiguration — HSV configuration.
  • Locale_Vehicle — Localized names.

Common Issues

  1. Speed_Max multiplied by 1.25TargetForwardVelocity is silently scaled for non-train vehicles. A speed of 80 becomes 100.
  2. Steer_Max backward compatibilitySteer_Max is multiplied by 0.75. The newer Steering_Angle_Max avoids this.
  3. Wheel auto-generation requirements — If no WheelConfigurations is provided, the legacy Tires/Wheels layout must exist. Misnamed transforms produce errors.
  4. Battery mode defaultsBatteryMode_Driving charges, BatteryMode_Headlights and BatteryMode_Sirens burn. Misconfiguration can charge while lights are on.
  5. Default physics profile only for mass-1.0 vehicles — If the prefab has non-default mass, the profile is not auto-assigned.
  6. Shared skin lookup GUID — When not set, _sharedSkinLookupGuid defaults to the asset GUID, requiring vehicle-specific skins.