Hello, It is a bit hard to understand what Is the problem here. Does It give you any error code? did you debug It? As far as I see, I think you have a few spelling errors in my opinion in:
local rl = hinges.rl
local rr = hinges.rl
both of them are using
hinges.rl
maybe start the debugging process
script.Parent.Changed:Connect(function(property)
if property == "Throttle" or property == "Steer" then
-- Your code here
end
end)
There were a few issues.
The biggest was that you had the steering script referencing the fl instead of the flsteering hinge (as well as the others)
Having different Part Densities when you use Constraints is an issue. It affects the way they react to each other.
Hinges are a bit too springy for making steering. You could add an invisible rod using Attachments a couple of studs behind the steering HingeConstraints. This would keep both wheels at the same angle. The model I added shows how I use a Motor instead, which is a controllable weld. It stiffens up the steering quite a bit, and you can use offsets to create Ackerman steering angles (inboard wheel angles more than the outboard one. This will also work with your double wishbone suspension.
I tweaked some of the numbers for the springs and the hinges, and added them to folders (instead of a model) so they are easier to find.
I added a couple of changes to the script so it enables welds at the rear axles so they don’t swivel at all when the rear wheel steering is false.
I also made it so the script doesn’t have more code running than it needs to when controlling your steering and throttle (resetting the motors every input).
I also changed your wheels from Balls with Meshes to Cylinders. This helps with traction since there’s more contact, and it also means your wheels won’t contact other items in game since they stick out farther than they appear to. I increased Density as well as Friction on the wheels.
You’ll have to do some fine tuning but it should work better for you now. verybrokenchassis.rbxm (17.8 KB)
Add an Attachment at the same location as the steering one in the LH steering Part.
Move the Attachment 2 studs forward (or back, doesn’t matter).
Add another Attachment on the RH steering Part. Move it forward (or back).
Add a RodConstraint between the 2 new Attachments.
This links both the LH and RH HingeConstraints so they won’t turn at different amounts.
Have a look at the way I did it to get a visual, but don’t follow that setup since it controls the steering completely differently.