StateCar
The ac.StateCar object provides direct access to vehicle memory. Most properties are read-only.
| Property | Type | Description |
|---|---|---|
| A | ||
aabbCenter | vec3 | Center of AABB (calculated from LOD D or collider mesh). |
aabbSize | vec3 | Size of AABB in meters (calculated from LOD D or collider mesh). |
absInAction | boolean | ABS is currently intervening. Physics-only |
absMode | integer | 0 for disabled ABS. Physics-only |
absModes | integer | 0 if ABS is not present. Physics-only |
acceleration | vec3 | G-forces, X for sideways relative to car, Z for forwards/backwards. |
activeLOD | integer | 0-based index of visible LOD. |
adjustableTurbo | boolean | Whether the turbo is adjustable. Physics-only |
aeroDrag | number | Aero drag coefficient. |
aeroLiftFront | number | Aero lift coefficient in front. |
aeroLiftRear | number | Aero lift coefficient in rear. |
aiAggression | number | AI aggression from 0 to 1 (or -1 if there is no AI). Note: aggression level set in a launcher will be multiplied by 0.95, so 100% aggression will show up as 0.95 here. |
aiLapsLeft | integer | Number of laps left to make for AI before going to pits. |
aiLevel | number | AI level from 0 to 1 (or -1 if there is no AI). |
altitude | number | Altitude in meters above sea level. |
ambientOcclusion | number | Ambient occlusion value computed from prebaked data from track's VAO patch. 0 for car fully shadowed (in a tunnel), 1 for car outside. Affected by WeatherFX adjustments. |
angularVelocity | vec3 | Angular velocity of the car. |
anyFlamesActive | boolean | True if any of car flames are currently shown. |
autoClutch | boolean | Returns true if auto-clutch is active. Physics-only |
autoShift | boolean | Returns true if automatic shifting is active. Physics-only |
awdCenterLock | number | AWD center lock value. Physics-only |
awdFrontShare | number | AWD front torque share. Physics-only |
| B | ||
ballast | number | Ballast in kg. |
batteryVoltage | number | Current battery voltage. |
bestLapFromGhost | boolean | If true, lapTimeMs is not from this session, but from the ghost player is racing against. Can't be true online. |
bestLapSplits | integer[] | Splits times of best lap (not necessarily best split times in itself), in milliseconds. Items start with 0. |
bestLapTimeMs | integer | Time of best lap of this session in milliseconds. |
bestSplits | integer[] | Best splits times (and not splits of best lap), in milliseconds, unlike other split lists, this one is populated with zeroes for sectors without time from the start. Items start with 0. |
bodyTransform | mat4x4 | Car visual transformation (the one applied to 3D model). |
bodyWetness | number | How wet is car exterior, approximation from 0 to 1 (actual wetness is in 2D map). |
brake | number | Brake, from 0 to 1. |
brakeBias | number | Current brake bias. Physics-only |
brakeLightsActive | boolean | True if brake lights are on. |
brakesBiasLimitDown | number | Lower limit for brake bias. Physics-only |
brakesBiasLimitUp | number | Upper limit for brake bias. Physics-only |
brakesBiasStep | number | Step size for brake bias adjustment. Physics-only |
brakesCockpitBias | boolean | Whether brake bias can be adjusted from the cockpit. Physics-only |
| C | ||
carCamerasCount | integer | Number of F6 cameras. |
caster | number | Caster angle in degrees. |
cgHeight | number | Center of gravity height. |
clutch | number | Clutch, from 0 to 1 (1 for pedal fully depressed). |
collidedWith | integer | 0 for track, non-zero for cars. |
collisionDepth | number | How deep is current collision, in meters. |
collisionPosition | vec3 | Coordinates of current collision in car space. |
compass | number | Angle of where car is heading, from 0 to 360 (0/360 for north, 90 for east, etc.) |
compoundIndex | integer | Index of currently selected tyre compounds. |
currentEngineBrakeSetting | integer | Current engine brake setting index. |
currentPenaltyParameter | integer | Parameter of current penalty (role depends on penalty type). |
currentPenaltyType | ac.PenaltyType | Current penalty type (set only for user car). |
currentSector | integer | 0-based index of current track split. |
currentSplits | integer[] | Time for different splits of current lap, in milliseconds. Items start with 0. |
customCarColor | rgb | Custom car color selected online, or math.nan if color is the default one |
| D | ||
damage | number[] | Damage values from 0 to maximum collision speed in km/h for four different zones (fifth one is not really used). 5 items, starts with 0. |
daytimeRunningLights | boolean | True if DRLs are active. |
differentialCoast | number | Differential coast setting. Physics-only |
differentialPower | number | Differential power setting. Physics-only |
differentialPreload | number | Differential preload setting. Physics-only |
dirt | number | Body dirt level from 0 to 1. |
distanceDrivenSessionKm | number | Distance driven in current session in km. |
distanceDrivenTotalKm | number | Total distance driven in km. |
distanceToCamera | number | Distance to camera in meters. |
driftComboCounter | integer | Drift combo counter (calculated in any racing mode). |
driftInstantPoints | number | Drift instant points (calculated in any racing mode). |
driftPoints | number | Drift points (calculated in any racing mode). |
drivenInRace | number | Distance driven in current race in meters. |
driverEyesPosition | vec3 | In-car coordinates for driver eyes position (can be changed by user). |
drivetrainPower | number | Current drivetrain power output. Physics-only |
drivetrainSpeed | number | Speed delivered to wheels. |
drivetrainTorque | number | Current drivetrain torque output. Physics-only |
drsActive | boolean | True if DRS is currently deployed. Physics-only |
drsAvailable | boolean | True if DRS is available to be used. Physics-only |
drsPresent | boolean | True if the car is equipped with DRS. Physics-only |
| E | ||
engagedGear | integer | Current gear, 0 for neutral, -1 for reverse. Goes through 0 on sequential shifts |
engineBrakeSettingsCount | integer | Number of available engine brake settings. |
engineLifeLeft | number | Engine life left (1000 for new engine, breaks at 0). |
enginePosition | integer | 0 for unspecified, 1 for front, 2 for rear, 3 for mid. Physics-only |
estimatedLapTimeMs | integer | Based on best lap and performance meter (delta of this lap time vs best lap time). |
exhaustTemperature | number | Current exhaust temperature. |
exposureInside | number | Onboard exposure from car.ini |
exposureOutside | number | Outboard exposure from car.ini |
extendedPhysics | boolean | True if extended car physics is active. |
extraA | boolean | Extra switch A state. |
extraB | boolean | Extra switch B state. |
extraC | boolean | Extra switch C state. |
extraD | boolean | Extra switch D state. |
extraE | boolean | Extra switch E state. |
extraF | boolean | Extra switch F state. |
extraG | boolean | Extra switch G state. |
extraH | boolean | Extra switch H state. |
extraI | boolean | Extra switch I state. |
extraIconsCount | integer | Extra driver icons set with ui.UserIconsLayer(). |
extraJ | boolean | Extra switch J state. |
extraK | boolean | Extra switch K state. |
extraL | boolean | Extra switch L state. |
extraM | boolean | Extra switch M state. |
extraN | boolean | Extra switch N state. |
extraO | boolean | Extra switch O state. |
extraP | boolean | Extra switch P state. |
extrapolatedLapTimeMs | integer | Graphics-corrected time of current lap in milliseconds. |
extrapolatedMovement | boolean | If set to false and you're adding objects moving close to cars, use ac.CarState.timestamp to estimate dt. |
extraQ | boolean | Extra switch Q state. |
extraR | boolean | Extra switch R state. |
extraS | boolean | Extra switch S state. |
extraT | boolean | Extra switch T state. |
| F | ||
ffbBase | number | Value of FFMULT from car.ini. |
ffbFinal | number | Final FFB value sent to wheel. |
ffbMultiplier | number | For 100% FFB multiplier, this value is set to 1. |
ffbPure | number | Pure FFB value before multipliers. |
ffbSteerAssist | number | Value of STEER_ASSIST from car.ini. Broken until 0.3.0. |
flashingLightsActive | boolean | True if flashing lights (strobe) are active. |
focused | boolean | True if the camera is focused on this car. |
focusedOnInterior | boolean | True if the camera is focused on the interior of this car. |
fuel | number | Remaining fuel in liters. |
fuelMap | integer | Current fuel map preset. |
fuelMaps | integer | Number of available fuel maps. |
fuelPerLap | number | Uses original AC fuel estimation. Zero until value is available. Physics-only |
| G | ||
gas | number | Throttle, from 0 to 1. |
gear | integer | Current gear, 0 for neutral, -1 for reverse. Does not go through 0 on sequential shifts |
gearboxDamage | number | Gearbox damage (0 for new gearbox, 1 for non-functional). |
gearCount | integer | Excluding neutral and reverse. Physics-only |
graphicsOffset | vec3 | Graphics offset from car.ini |
graphicsPitchRotation | number | Graphics pitch rotation in radians from car.ini |
graphicsToPhysicsTransform | mat4x4 | Graphics-to-physics transform based on graphics offset and pitch rotation from car.ini |
groundDistance | number | Distance of ground below car (defines ground plane together with normal). |
groundNormal | vec3 | Normal of ground below car. |
| H | ||
handbrake | number | Handbrake, from 0 to 1. |
hasAnalogTelltale | boolean | Car has max RPM arrow. |
hasCockpitERSDelivery | boolean | Car has cockpit ERS delivery adjustment. |
hasCockpitERSRecovery | boolean | Car has cockpit ERS recovery adjustment. |
hasCockpitMGUHMode | boolean | Car has cockpit MGU-H mode adjustment. |
hasCockpitSwitchForUserSpeedLimiter | boolean | Car has a cockpit switch for the speed limiter. Physics-only |
hasEngineBrakeSettings | boolean | Car has engine brake settings. |
hasFlashingLights | boolean | Car has flashing lights (strobe). |
hasHornAudioEvent | boolean | Car has a horn audio event defined. |
hasLowBeams | boolean | If set to false, low beams are not present (headlights operate in a single mode). |
hasTurningLights | boolean | There could be other components linked to turn signals state, but this variable is about emissives tied to turn signals. |
hasUserBrakeBias | boolean | Car allows user to adjust brake bias. Physics-only |
hazardLights | boolean | True if hazard lights are on. |
headlightsActive | boolean | True if headlights are on. |
headlightsAreHeadlights | boolean | If set to false, headlights do something else (like change display mode). |
headlightsColor | rgb | Color of the headlights. |
highBeams | boolean | true if high beams are currently active (either with headlights active, or with high beams flashing). |
hornActive | boolean | True if horn is currently active. |
hShifter | boolean | True if car has H-shifter in its physics data. |
| I | ||
index | integer | 0-based (0 for first car). |
isActive | boolean | True if car is currently active (changes to false for disconnected cars if server does not have them visible). |
isAIControlled | boolean | True if car is controlled by AI (or that autopilot thing). |
isAIGoingToPits | boolean | True if AI is going to go to pits when possible. |
isAIUsingRainTyres | boolean | True if AI is using rain tyres now. |
isCameraOnBoard | boolean | True if camera is inside this car. |
isChangingTyres | string | Car is in pits and is currently having its tyres changed. |
isConnected | boolean | True if car is currently connected (cars can be disconnected online), or if car is not a remote one. |
isDriftBonusOn | boolean | Drift bonus flag (calculated in any racing mode). |
isDriftCar | boolean | Car counts as a drift car if it has a corresponding tag or “drift” in its name. |
isDriftValid | boolean | Is drift valid (calculated in any racing mode). |
isDriverDoorOpen | boolean | True if driver door is open. |
isDriverSeatbeltOn | boolean | Same as SEATBELT input. |
isDriverVisible | boolean | Driver can be hidden by apps or Lua scripts too. |
isEngineDiesel | boolean | Check is based on car tags. |
isEngineLimiterOn | boolean | True if engine limiter is active. |
isGearGrinding | boolean | True if gears are currently grinding. |
isHidingLabels | boolean | If you're drawing a map, don't show cars with this flag on. Flag can change during the race |
isInPit | boolean | True if car is parked in its pit stop place. |
isInPitlane | boolean | True if car is in pits area. |
isKunosCar | boolean | True if car is standard, from Kunos. |
isLapValid | boolean | True if current lap is valid. Physics-only |
isLastLapValid | boolean | True if last lap was valid. |
isLeftHandDrive | boolean | If set to true, steering wheel is on the left side. |
isOpenWheeler | boolean | Check is based on car tags. |
isRaceFinished | boolean | Car has finished the race. Since 0.2.8, non-race sessions are never marked as finished. |
isRacingCar | boolean | True for racing cars (cars with class different from “road” or “street”). |
isRallyCar | boolean | Car counts as a rally car if it has a corresponding tag or “rally” in its name. |
isRefueling | string | Car is in pits and is currently being refueled. |
isRemote | boolean | True if car is controlled by another player online. |
isRepairing | string | Car is in pits and is currently being repaired. |
isRequestingPitStop | boolean | True if car is requesting to go to pits. |
isRetired | boolean | True if car has retired from the session. |
isUserControlled | boolean | True if car is controlled by user (controls could be disabled completely). |
| J | ||
justJumped | boolean | Changes to true for a single frame when car jumps. |
| K | ||
kersButtonPressed | boolean | True if KERS button is pressed. Physics-only |
kersCharge | number | Current KERS charge level. |
kersCharging | boolean | True if KERS is currently charging. |
kersCurrentKJ | number | Current KERS energy in KJ. |
kersHasButtonOverride | boolean | True if KERS has a button override. Physics-only |
kersInput | number | KERS input value. |
kersLoad | number | Current KERS load. |
kersMaxKJ | number | Maximum KERS energy in KJ. |
kersPresent | boolean | True if KERS is present on the car. Physics-only |
| L | ||
lapCount | integer | Number of completed laps in this session (within connection online), including spoiled laps. |
lapCutsCount | integer | Number of lap cuts in current lap. Physics-only |
lapTimeMs | integer | Time of current lap in milliseconds. |
lastLapCutsCount | integer | Number of lap cuts in last lap. |
lastSplits | integer[] | Time for different splits of last lap, in milliseconds. Items start with 0. |
localAngularVelocity | vec3 | Angular velocity in local space. |
localVelocity | vec3 | Velocity in local space. |
look | vec3 | Vector facing forward (normalized). |
lowBeams | boolean | true if low beams switch is currently active (doesn't depend on the state of headlights, just on the switch state). |
| M | ||
manualPitsSpeedLimiterEnabled | boolean | Returns true if manual pits speed limiter is currently active. Physics-only |
mass | number | Car mass in kg. |
maxFuel | number | Maximum amount of fuel in liters. |
maxRelativePlankWear | number | From 0 to 1. 0 if not available. Physics-only |
mguhChargingBatteries | boolean | True if MGU-H is charging batteries. |
mgukDelivery | integer | MGU-K delivery mode. Starts with 0. |
mgukDeliveryCount | integer | Number of MGU-K delivery modes. |
mgukRecovery | integer | MGU-K recovery level from 0 to 10 (for 100%). |
minHeight | number | Minimum allowed ride height in meters. |
| N | ||
nodeIndex | integer | Car index if 0 is nearest to camera, 1 is second nearest and so on. |
| O | ||
oilPressure | number | Current oil pressure. |
oilTemperature | number | Current oil temperature. |
| P | ||
p2pActivations | integer | Number of Push-to-Pass activations. |
p2pStatus | integer | Push-to-Pass status. |
performanceMeter | number | Performance meter comparing this lap with best, seconds. |
performanceMeterSpeedDifferenceMs | number | In AC performance app, there is that red/green bar, it shows this value. |
physicsAvailable | boolean | Cars in replays, or remote cars online do not have regular physics component running, so some data will be missing. |
physicsToGraphicsTransform | mat4x4 | Physics-to-graphics transform based on graphics offset and pitch rotation from car.ini |
ping | integer | Ping in ms (or -1 if not available). |
pitTransform | mat4x4 | Transformation of pit position. |
position | vec3 | Car position in the world (corresponds to 0 coordinate in its model space). |
poweredWheelsSpeed | number | Can be used for speedometers if they're not using GPS and instead use powered wheels, value in km/h. |
prefersImperialUnits | boolean | True for cars from UK or USA. |
previousLapTimeMs | integer | Time of last lap in milliseconds. |
previousSectorTime | integer | Time of previous split in milliseconds, or 0 if it's a first split. |
| R | ||
racePosition | integer | Position of a car in the race, 1 for first, 2 for second, etc. |
rawAmbientOcclusion | number | Ambient occlusion value computed from prebaked data from track's VAO patch. Not affected by WeatherFX adjustments. |
resetCounter | integer | Increases by 1 each time a car resets. |
restrictor | number | Restrictor value. |
rideHeight | number[] | 0 for front, 1 for rear. 2 items, starts with 0. |
rpm | number | Engine RPM. |
rpmLimiter | number | RPM limiter threshold, if exists. |
rpmMinimum | number | Minimum RPM (or -1 if physics not available). |
| S | ||
sessionID | integer | Index of a car in an online race (differs from regular car index). |
sessionLapCount | integer | Laps completed in the current session. |
shakeMultiplier | number | SHAKE_MUL value from car.ini |
side | vec3 | Vector facing sideways (normalized). |
sirenHorn | boolean | If set to true, horn is working in siren mode (press to toggle). |
speedKmh | number | Current speed in km/h. |
speedLimiter | number | Returns pit limiter speed in km/h or 0 if no limit is currently active. Physics-only |
speedLimiterInAction | boolean | Speed limiter is currently restricting speed. Physics-only |
speedMs | number | Current speed in m/s. |
splinePosition | number | Position of car along the track, 0 for starting line, 1 for finishing line. |
steer | number | Angle of steering wheel in degrees. |
steerLock | number | Maximum steering wheel angle in degrees. |
steerTorque | number | Current steering torque. |
| T | ||
timestamp | number | Time of last physics state record, in milliseconds. |
tractionControl2 | number | Traction control 2 setting. |
tractionControl2Modes | integer | Number of modes for TC2. |
tractionControlInAction | boolean | TC is currently intervening. Physics-only |
tractionControlMode | integer | 0 for disabled TC. Physics-only |
tractionControlModes | integer | 0 if TC is not present. Physics-only |
tractionType | integer | 0 for rwd, 1 for fwd, 2 for awd, 3 for new awd, -1 for N/A. Physics-only |
transform | mat4x4 | Car physics transformation in world space (does not match body transformation). |
turboBoost | number | Turboboost value, from 0 and upwards. |
turboBoosts | number[] | Values per each turbo, up to 8. 8 items, starts with 0. Physics-only |
turboCount | integer | Number of turbos. Physics-only |
turboWastegates | number[] | Values per each turbo, up to 8. 8 items, starts with 0. Physics-only |
turningLeftLights | boolean | True if left turn signal is on. |
turningLeftOnly | boolean | True if only left turn signal is on. |
turningLightsActivePhase | boolean | True if the turn signal is currently in the 'on' part of its blink cycle. |
turningRightLights | boolean | True if right turn signal is on. |
turningRightOnly | boolean | True if only right turn signal is on. |
| U | ||
up | vec3 | Vector facing upwards (normalized). |
useInternalAudio | boolean | If true, …_int variants of audio events are used. |
userSpeedLimiterEnabled | boolean | Returns true if custom physics speed limiter is currently active. Physics-only |
| V | ||
velocity | vec3 | Car velocity in m/s. |
visibleIndex | integer | Car index if 0 is nearest to camera and visible in main camera. |
| W | ||
waterTemperature | number | Approximation of water temperature in °C done by original AC. |
wheels | ac.StateWheel[] | 4 items, starts with 0. |
wheelsOutside | integer | Number of wheels outside of allowed area. |
wiperMode | integer | Stores previous active mode when wipers are disabled, but still have a loop to complete. |
wiperModes | integer | Number of wiper modes, no less than 1. |
wiperProgress | number | Current progress of the wiper cycle. |
wiperSelectedMode | integer | Actual selected mode. |
wiperSpeed | number | Current speed of the wipers. |
worldToLocal | mat4x4 | Inverse of car visual transformation. |
| Y | ||
year | integer | Manufacturing year. |