Chassis not moving

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.
image
image

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)

Make sure there are no welds in the baseplate or rest of the chassis to the baseplate. These kinds of welds are automatically created when JoinSurfaces is switched on. Try using the move tool to lift the chassis up slightly and check that it is all unanchored.

Seems to be no welds attached to the car with the baseplate. tjNrux6ttO

The car is a bit glitchy with it’s main body part curving a bit to the side but that’s because of the spring constraint properties I have not set yet (I think.)

1 Like

When you try to drive it, are there any errors in the output? And maybe try putting prints into your code to check which parts are working.

Also, I don’t see anything calling the drive function in your script. Make sure it’s being activated by something like seat.Changed

1 Like

I run it every frame. It would simply not work at all if I tried to use this only when say Seat.SteerFloat changes. No errors as far as I can see, and I wouldn’t need prints in my opinion because it shows the changes in HingeConstraint’s properties. (Unless you are thinking something else.)

Also, have you set the constraint types manually? Like ActuatorType should not equal “none”.

Yes. That’s how I was able to set motormaxtorque and what not.

I think you should use seat.Changed:Connect to activate it instead of server heartbeat. This means that it only updates when you put input. Server heartbeat means that it is always updating and could cause lag. And you can run .Changed on the whole seat, not just on a single property.