I change script:
Script.TireMass = 5
Script.SpringForce = 1000
function Script:Start()
self.Wheels={}
self.Wheels[0]=self.entity:FindChild("WheelFL")
self.Wheels[1]=self.entity:FindChild("WheelFR")
self.Wheels[2]=self.entity:FindChild("WheelRL")
self.Wheels[3]=self.entity:FindChild("WheelRR")
self.Amortisseurs={}
self.Axis={}
self.SecondAxis={}
for n=0,3 do
pos=self.Wheels[n]:GetPosition(true)
self.Axis[n]=Pivot:Create(self.entity)--
self.Axis[n]:SetPosition(pos, true)
axe=Vec3(0, 1, 0)
self.Amortisseurs[n]=Joint:Slider(pos.x, pos.y, pos.z, axe.x,axe.y,axe.z, self.Axis[n], self.entity)
self.Amortisseurs[n]:EnableLimits()
self.Amortisseurs[n]:SetLimits(-1,1)
self.Amortisseurs[n]:SetSpring(self.SpringForce,0.25,5)
end
self.Volants={}
for n=0,1 do
axe=Vec3(0, 1, 0)
self.SecondAxis[n] = Pivot:Create(self.Axis[n])--
pos=self.Wheels[n]:GetPosition(true)
self.SecondAxis[n]:SetPosition(pos, true)
self.Volants[n]=Joint:Hinge(pos.x, pos.y, pos.z, axe.x,axe.y,axe.z, self.SecondAxis[n], self.Axis[n])
self.Volants[n]:EnableLimits()
self.Volants[n]:SetLimits(-30,30)
self.Volants[n]:SetMotorSpeed(200)
self.Volants[n]:EnableMotor()
self.Volants[n]:SetAngle(0)
end
for n=2,3 do
pos=self.Wheels[n]:GetPosition(true)
axe=Vec3(1, 0, 0)
self.Volants[n]=Joint:Hinge(pos.x, pos.y, pos.z, axe.x,axe.y,axe.z, self.Wheels[n], self.Axis[n])
self.Volants[n]:EnableLimits()
self.Volants[n]:SetLimits(-30,30)
self.Volants[n]:SetMotorSpeed(200)
self.Volants[n]:EnableMotor()
self.Volants[n]:SetAngle(0)
end
self.ThirdAxis={}
for n=0,1 do
pos=self.Wheels[n]:GetPosition(true)
axe=Vec3(1, 0, 0)
self.ThirdAxis[n]=Joint:Hinge(pos.x, pos.y, pos.z, axe.x,axe.y,axe.z, self.Wheels[n], self.SecondAxis[n])
self.ThirdAxis[n]:EnableLimits()
self.ThirdAxis[n]:SetLimits(-30,30)
self.ThirdAxis[n]:SetMotorSpeed(200)
self.ThirdAxis[n]:EnableMotor()
self.ThirdAxis[n]:SetAngle(0)
end
end
--[[
function Script:UpdateWorld()
end
]]
function Script:UpdatePhysics()
end
--[[
--This can be used to select which objects an entity collides with. This overrides collision types completely.
function Script:Overlap(e)
return Collision:Collide
end
]]
--[[
function Script:Collision(entity, position, normal, speed)
end
]]
--[[
function Script:Draw()
end
]]
--[[
function Script:DrawEach(camera)
end
]]
--This function will be called after the world is rendered, before the screen is refreshed.
--Use this to perform any 2D drawing you want the entity to display.
function Script:PostRender(context)
end
--[[
--This function will be called when the entity is deleted.
function Script:Detach()
end
]]
--[[
--This function will be called when the last instance of this script is deleted.
function Script:Cleanup()
end
]]
--[[
--This function will be called upon completion of a one-shot animation played with the PlayAnimation() command.
function Script:EndAnimation(sequence)
end
]]
But nothing happens.
Запись_2019_05_04_13_23_40_651.mp4
MyCar.rar