Hinge constraints are not working

I’m trying to make a wheel turn but it’s just not working.

Video ;


Script ;

-- server script

local RunService = game:GetService('RunService')

local Folder = workspace.Cars

RunService.Stepped:Connect(function()
	for _, Car:Model in Folder:GetChildren() do
		local DriverSeat:VehicleSeat = Car.Seats:FindFirstChildWhichIsA('VehicleSeat')
		
		if not DriverSeat then continue end
		
		for _, Wheel:BasePart in Car.Wheels:GetChildren() do
			Wheel.Rim.HingeConstraint.AngularVelocity = DriverSeat.Throttle * 50
			
			if Wheel:FindFirstChild('Servo') then
				Wheel.Servo.HingeConstraint.TargetAngle = (DriverSeat.Steer * 30)
				
				print(Wheel.Servo.HingeConstraint.TargetAngle)
			end
		end
	end
end)

Screenshot of the constraints ;
image

But how are the Properties of the HingeConstraint set up?
Do you have both the Torques set high?

Seems like that link is broken. Thanks to @nidbahn for this wayback link:

Here’s the properties of the hinge constraint, I don’t know if 100 is counted as “high”


Edit : In the link you gave me, the videos don’t play.

Crank the torque waaaay up. For my steering I use something around 1,000,000,000. I find that using values at inf seems to make some servos a little glitchy.

You gotta just play around with the numbers.

I’m going to report the car tutorial as broken, let’s see if they fix it or add it to their new documention.

It still bounces, even after setting it to 10 million. Should I put the hinges on top of the suspension instead of the bottom?

I didn’t say 10 million, I said 1 billion…

The other issue is if you don’t align the hinge with the wheel centerline then the wheel spinning forward will try to turn around the steering hinge.
I’ve also used welded motors with rods connecting them to the steering, like a real car does. This balances out the forces, and the motor is way less springy than a HingeConstraint.
Try this place out: Tracked vehicle, suspension and racing tests. - Roblox

2 Likes

Oh ok, yea 1 billion and the hinges being on top of the suspension works very well, thanks!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.