Roblox Spring Constraint Inverting Itself

Here is what I have:
image
That is a wheel connected to the chassis with a spring.

Here is what happens:
image
The spring inverts itself, essentially going past the first part and staying there.
This is an edge case thing that I want to fix.

All four wheels and their suspensions have the same issue.
Children Explorer:
image
It’s the same in the front

I have tried to fix it with this:

for _, wel in ipairs(chas.Wheels:GetChildren()) do --stupid suspension problems
			if wel:IsA("Part") then
				local fram = chas.Frame
				local tPos = fram.CFrame:toObjectSpace(wel.CFrame)
				if tPos.Y > 0.5 then
					print(wel.Name.." is over the frame. Fixing that!")
					local nObjCf = CFrame.new(Vector3.new(tPos.X, -1.4, tPos.Z))
					local nPos = fram.CFrame:toWorldSpace(nObjCf) --converts the cframe to a useable world position
					wel.Position = nPos.Position
				end
			end
		end

By getting the localposition of the object then applying a new world position that is below the local position.
However, it does move the wheel downwards but the spring gets angry (to say the least) and sends the car to the void.

Attempted Modifications:

  1. Raise the car up about 10 studs with a debounce
  2. Simple Debounce

Both Failed.

All I need is a simple way to stop the springs from inverting, or return them to their original state.

Your spring might not be powerful enough, try raising the stiffness.

Also, you can try limiting the travel distance of the wheel with a Prismatic constraint, assuming the wheel can only go straight up and down.

I would rather avoid giving you the file because it is from a commission so I dont know if my client would like that I spread something he bought, and I dont want to have something I can sell be free immediately.

Although I dont see why giving you more code would help my problem. Ultimately it should be a physics issue or a mistake I made in the code snippet that is the cause of my issues. And ideally the spring shouldn’t even do this type of thing.

Ah, should I simply make the Prismatic Constraint a servo? I haven’t seen a limits enabled option for an actuator type of None. And increasing stiffness in my springs makes my suspension do things differently from what I want.

Spring Properties:
Dampening 2500
MaxForce inf
Stiffness 8000

Making it a servo/motor should be fine, just set the maximum torque to 0 and it shouldn’t do anything other than constrain the wheels when you set the limits

Thank you very much, I’ll try this tomorrow morning.