Wheel Collider suspension effects

I’m trying to work on a “suspension squeaking” system for my vehicle game.

The way I’d like it to work is when the suspension is >= the target distance, it will play one sound.
And if it’s below the target distance, it will play the other.

Here is an example from a game called BeamNG.drive

What I think I need to do is to find the distance of the suspension, from the Target position, and the resting position, eg, when there is no weight on the wheel colliders. Then I’d just set the volume and play the sound.

I just don’t know how to find where the suspension position is :confused:

It’s not exposed, you have to calculate it yourself. A method is using the distance from the wheel position to WheelHit.point. Subtract the radius to get the “suspension extension”. You may use the wheel’s suspension distance to get either the “compression distance” or an extension or compression ratio.

1 Like