Making a Rigidbody Car 'Jump'

Hello all, I am currently building a cartoon racing game in which the player has the ability to ‘jump’ to avoid rockets and such. In Unity 4.6, this was achieved by simply applying an upwards force on the car’s Rigidbody, however, in Unity 5, the car is not stable when it jumps, and will roll midair if the player attempts to jump while turning. I believe the problem may be related to the new suspension system of the WheelColliders in Unity 5, which I finally got to work well enough.

This is what I used to jump in Unity 4.6:

function Jump () {
    if (wheelRL.isGrounded || wheelRR.isGrounded) {
        if (RebindableInput.GetKeyDown("Jump") || RebindableInput.GetKeyDown("JumpSecondary")) {
                GetComponent.<Rigidbody>().AddRelativeForce(0, JumpSpeed, 0);
        }
    }
}

I have attached screenshots of the Rigidbody and WheelCollider settings and values. Any help is much appreciated, I have been trying to make this simple feature work in Unity 5 for far too long.

Thanks!



One possibility is adding a velocity vector (0, +9.81 * desiredHeight, 0) to the rigid body’s velocity.

Unfortunately, changing the velocity produces pretty much the same result. Here are some videos of the project in action, I hope to clarify what the exact problem is. The car tumbles in Unity 5, and the WheelColliders are pretty much the only change. Thanks for any help you can offer!

The files were too large to upload so here are mediafire links for them…
Unity 4.6: http://www.mediafire.com/watch/qxf2x21fdkoli22/Unity_4.6.avi

Unity 5: http://www.mediafire.com/watch/7i9tgiceqifwz37/Unity_5.avi

What’s the vehicle’s center of gravity? And what happens when you try to add a relative force at a position?

Vector3 worldForcePosition = transform.TransformPoint(yourLocalForcePosition);
rigidbody.AddForceAtPosition(force, worldForcePosition);

The CG is shifted downwards by 0.3, but that is all. I have also tried various implementations of the ForceAtPosition, however all of them produce the same, or some such variation of the same results. The car doesn’t just bounce up nicely like it used to. I have a feeling it it the suspension system, since I used the new WheelCollider suspension in Unity 5, and had no such suspension in Unity 4. Can I somehow make the wheel suspension have less of an effect on the rigidbody’s tilt, would that even help? It works fine in Unity 5 when all wheels are fully compressed and the car is stationary, but when motion is involved, it just tumbles. Let me know if you have any other ideas…

One possible hack is increasing the angular drag as soon as the car jumps, then resetting the angular drag as soon as the wheels touch the ground.

That does seem to do the trick, however, sometimes the angular drag will not change when it jumps or when it touches the ground again. I may just use Trigger colliders for that instead of wheel.isGrounded. Thanks for all your help!