local carNode = ac.findNodes('carRoot:0')
local animDir = ac.getFolder(ac.FolderID.ContentCars) .. '/' .. ac.getCarID(0) .. '/animations/steeringwheel.ksanim' 
local animDir2= ac.getFolder(ac.FolderID.ContentCars) .. '/' .. ac.getCarID(0) .. '/animations/driver_steer.ksanim' 
--local carSounds = ui.MediaPlayer()
--local engineOn = false
local previousGear = ac.getCar(0).gear
local currentGear = ac.getCar(0).gear
local lut, lut2
lut = ac.DataLUT11.parse("| -360=0.0 | 0=0.5 | 360=1.0 |")
lut2 = ac.DataLUT11.parse("| 0=1.0 | 40=0.0 | 300=-0.5 |")
--carSounds:setSource('./start.ogg')
--carSounds:setLooping(false)
--carSounds:setVolume(ac.getAudioVolume('main') * 1)

function counterSteering()
  carNode:setAnimation(animDir, lut.get(lut,ac.getCar(0).steer*lut2.get(lut2,ac.getCar(0).speedKmh)), true)
  carNode:setAnimation(animDir2, lut.get(lut,ac.getCar(0).steer*lut2.get(lut2,ac.getCar(0).speedKmh)), true)
end

local driver = ac.findNodes('DRIVER:DRIVER')
driver:storeCurrentTransformation()

function kickstand()
  if ac.getCar(0).extraB or ac.getCar(0).extraC then
    driver:setVisible(false)
  else
    driver:setVisible(true)
  end
end

local counter=0



function script.update(dt)
  counterSteering()
  kickstand()
  --startEngine(dt)
  --gearSound() 
end