Red = Constraints parts;
green = wheels;
yellow = weight
Here is the code that I use to calculate stiffness/damping
for i,v in pairs(game.ReplicatedStorage.Models.Vehicles.VehiclesCivilians:GetChildren()) do
local mass = 0
for a,b in pairs(v:GetDescendants()) do
if (b:IsA("BasePart")) then
if (b.Massless == false) then
mass += b:GetMass()
end
end
end
mass = mass * workspace.Gravity;
print(mass,mass * 0.04)
for a,b in pairs(v:GetDescendants()) do
if (b:IsA("SpringConstraint")) then
b.Stiffness = mass
b.Damping = mass * 0.04
end
end
end
Why use a script?
With my suspension vehicles I just go into Test mode and play with the SpringConstraint’s values until the vehicle rides the way I want it to, then set the values after I hit Stop in Test mode.
With suspension vehicles I usually set the wheels’ Density to 2, and the main body Part (your ‘weight’) I set the Density to whatever works best in Test mode.
Any other chassis parts I make Massless = true so they don’t affect the handling of the car.
I just saw your video. It looks like the wheels are rubbing against something in the car. Go to Studio>File>Studio Settings>Physics>Are Contact Points Shown and click the box to turn it on.
You’ll see red spheres show up when 2 Parts are colliding with each other.
Are your wheels MeshParts?
MeshPart wheels aren’t typically round, so they bounce like that.
Try Welding an actual CanCollide Cylinder or Ball Part to your CanCollide off Mesh wheel.
Also, when I put my Hinges on my wheels I put the Attachments right at the center (0,0,0) of the Cylinder or Ball so that the hinge won’t ‘bend’ or wobble under a side load.
@Scottifly
So I found an error when the Wheels are Orientated to left or right, it works fine, so it’s clearly a collision issue!
But I don’t know what’s making this false collision on/off
Rotates wheels: Doesn’t flicker
Non rotated wheels: Flickers