This is currently my first time trying to attempt to make a chassis. I have got basic steering going, however the trouble is that my chassis doesn’t seem to be moving. The MotorMaxTorque value goes up when I move the car back and forwards (but it stays still), but I can’t seem to find any other issue with this.
Photo of the chassis wheel and it’s descendants.
local seat = script.Parent.Main.VehicleSeat
local hubFL = script.Parent.ChassisWheelFL.Hub
local hubFR = script.Parent.ChassisWheelFR.Hub
local hubBL = script.Parent.ChassisWheelBL.Hub
local hubBR = script.Parent.ChassisWheelBR.Hub
local function movement()
local steer = hubFR.Parent.Top.CylindricalConstraint.LowerAngle
local max = 30
local goal = seat.SteerFloat * max
local steer = steer + (goal - steer) * seat.TurnSpeed
hubFR.Parent.Top.CylindricalConstraint.UpperAngle = steer
hubFR.Parent.Top.CylindricalConstraint.LowerAngle = steer
hubFL.Parent.Top.CylindricalConstraint.UpperAngle = steer
hubFL.Parent.Top.CylindricalConstraint.LowerAngle = steer
local angulargoal = seat.MaxSpeed * seat.ThrottleFloat
local torque = 10000
hubFL.HingeConstraint.AngularVelocity = angulargoal
hubFR.HingeConstraint.AngularVelocity = angulargoal
hubBL.HingeConstraint.AngularVelocity = -angulargoal
hubBR.HingeConstraint.AngularVelocity = -angulargoal
hubFL.HingeConstraint.MotorMaxTorque = torque * seat.ThrottleFloat
hubFR.HingeConstraint.MotorMaxTorque = torque * seat.ThrottleFloat
hubBL.HingeConstraint.MotorMaxTorque = torque * seat.ThrottleFloat
hubBR.HingeConstraint.MotorMaxTorque = torque * seat.ThrottleFloat
end
game:GetService("RunService").Heartbeat:Connect(movement)