Chassis is not moving

Hi. I am making a chassis for a test, everything is working just fine, but the only problem I am getting is that the Chassis cannot move, but tires can rotate when pressing A/D. The constraint I am using to move the chassis is Cylindrical Constraint, and its AngularActuatorType is Motor, the AngularVelocity is getting applied, but the chassis just don’t move, everything is unanchored. Help is appreciated :slight_smile:
Here’s the code:

local stop = script.Stop

local seat = Car.VehicleSeat;
local attFL = Car.Platform.AttachmentFL
local attFR = Car.Platform.AttachmentFR

local maxSteeringAngle = 30

local cyFL = Car.Platform.CylindricalFL
local cyFR =  Car.Platform.CylindricalFR
local cyRL =  Car.Platform.CylindricalRL
local cyRR =  Car.Platform.CylindricalRR

local steer = 0
local throttle = 0

local heartbeat

local function Update(dt)
    
    local steerGoal = -seat.SteerFloat * maxSteeringAngle;
    steer = steer + (steerGoal - steer) * math.min(dt * seat.TurnSpeed, 1) 
    attFL.Orientation = Vector3.new(0, steer, -90)
    attFR.Orientation = Vector3.new(0, steer, -90)
    
    local throttleGoal = seat.ThrottleFloat;
    throttle = throttle + (throttleGoal - throttle) * math.min(dt * seat.TurnSpeed)
    local torque = seat.Torque
    local speed = seat.MaxSpeed * throttle
    cyFL.MotorMaxTorque = torque
    cyFR.MotorMaxTorque = torque
    cyRL.MotorMaxTorque = torque
    cyRR.MotorMaxTorque = torque
    cyFL.AngularVelocity = speed
    cyFR.AngularVelocity = -speed
    cyRL.AngularVelocity = speed
    cyRR.AngularVelocity = -speed
    
end

local function Start()
    print("Start client")
    heartbeat = game:GetService("RunService").Heartbeat:Connect(Update)
end

local function Stop()
    print("Stop Client")
    heartbeat:Disconnect()
    script:Destroy()
end


Start()
if (stop.Value) then
    Stop()
    return
end
stop.Changed:Connect(function(shouldStop)
    if (not shouldStop) then return end
    Stop()
end)
1 Like

I usually use hinge for a car chassis. And set hinge mode into motor.

1 Like

No one is replying :frowning: I need help

1 Like

Any error in the output?That could help.

1 Like

There’s no error in the output, let me recheck.

1 Like

Could you show the screenshot of the 4 Cylindrical Constraints properties? Don’t see any issue in the code.

1 Like

Car
Here

1 Like

I meant the Properties of each of them, as said in my post.

Oh, lol sorry. Here:


carproperties2

I feel like the problem is with the InclinationAngle, the FL and RL One’s should be 90 and FR and RR should be -90.

1 Like

Okay, let me change them real quick.

1 Like

Nope, still not working, it should be working but it isn’t.

1 Like

If everything else is working, then I would say you should check if increasing the Torque may help. If not then just ensure once more that each and every part is unanchored.

1 Like

Yeah, everything else is working, tires are rotating when pressed A/D, and the angular velocity is also getting applied to the constraint. Let me check

1 Like

Thanks a lot man, you’ve helped me a lot. I increased the torque, and now it’s working. I just did torque^2 lol. Thank you so much :smiley:

2 Likes