@name car
@inputs P:wirelink
@outputs
@persist 
@trigger 
runOnTick(1)
rangerHitWater(1)

E = entity():isWeldedTo()
rangerFilter(E)
R = rangerOffset(100,E:massCenter(),vec(0,0,-1))
EE = R:position()
T = (P:number("A") - P:number("D")) * 10
F = (P:number("W") - P:number("S")) * -(P:number("Shift") ? 100 : 20)
Pos = EE - E:pos() + (E:right() * F) + vec(0,0,50)
Ang = -E:angles()
E:setMass(50000)


E:applyForce((Pos*50-E:vel())*E:mass())
E:applyAngForce((Ang:setYaw(T)*10-E:angVel())*E:mass())
