Making springy suspensions

Hello,

I am trying to build a quad bike, in Unity, with very springy suspension. I have it so that I drop the quad bike at 45 degrees and expect it to land on the flat plane terrain, rock on the suspension before coming to rest. I have built the quad bike as

  1. Rigid Body
    1.1 Front Left Wheel
    1.2 Front Right Wheel
    1.3 Rear Left Wheel
    1.4 Rear Right Wheel

The wheels are wheel collidors and have geometry as part of them, the actual wheel geometry. When I drop the quadbike onto the surface, it lands rear wheels first and then rotates around so that the front wheels come into contact with the terrain and then everything comes to rest.

The wheels are in sane positions, -ve x -ve z alternative to +ve x +ve z. Looking at the spring damping I have set mass as 1, suspension distance as 0.5

I have tried various combinations of spring damper i.e.

Spring 100
Damper 0.1

Spring 0.1
Damper 10

However the quad bike never rocks on it’s suspension, it always lands as if it’s absolutely rigid. Setting Target Position to either 0 or 1 also makes no difference. Even setting target position on front to 0, and rear of 1 also makes no difference.

One possibility is that the hierarchy is not set up correctly and that the wheels are being rendered in place, irrespective of where the wheel collider thinks it should be but I have double checked everything.

With the quad bike rigid body have a mass of 150kg, what would reasonable values for the spring damper be in order to see the body rock on the suspension from a drop of 2m?

I would at least expect to see the body compress when the quad bike first hits the floor, with the body falling lower onto the wheels but as it stands it lands absolutely rigidly with no play in it.

Ok, this gets weirder.

Setting spring to 1000 damper to 30 gets my wobbly suspension. Woot!

However, here’s the odd thing, it looks like the suspension is upside down! If I set the wheel collider, so the wheelcollider is over the rendered geometry of where the wheel should be, I see the ray moving downwards along the object’s Y. The object then comes to rest on top of the ray. which means my body is floating in mid air!

So if I have a suspension of 0.5, the wheel is placed where it should be (at rest) then I have a ray downwards of 0.5m. When the vehicle lands the suspension is on top of the world, extended by 0.5m.

So it looks like the suspension happens BELOW the wheel, rather than ABOVE it?

1194269--47263--$WheelCollider.jpg
Here you can see the object ABOVE the suspension.

Is my suspension around the wrong way? If I rotate them 180 degrees all hell breaks loose when it hits the landscape.

Am I meant to script so that I place the rendered wheel at the intersection of the wheel with the landscape?

Double check the alignment of your axis, man.

Which axis and alignment to what?

Axis of your objects. If pivot point of a wheel Y axis is oriented down and then the spring is oriented Y axis up, you will have probably the effect you have there.