@name CarBot
@inputs W_bt A_bt D_bt S_bt Shift_bt 
@persist V:vector Ang:angle Angs:angle Mul R
interval(1)

E = entity():isWeldedTo()

if(Shift_bt){Mul = 5000}
else{Mul = 2500}



if(W_bt){
V = -(E:forward()*Mul)
E:applyForce(V)}
if(S_bt){
V = E:forward()*Mul
E:applyForce(V)}
if(D_bt){AngRot = 90*1000
}  
if(A_bt){AngRot = -90*1000
}   

#Stab
R = -(E:angles():roll()*1000)
E:applyAngForce(ang(0,AngRot,(R + $R*5)))

