Calculate Force of WheelCollider hitting the ground?

I know there are a few topics about calculating the colliding force between 2 objects, but my problem is a little different.

I’m trying to calculate the force of impact of my WheelCollider hitting the ground. The WheelCollider is on a motorcycle with a rigidbody, but the ground collider doesn’t have any rigidbody or mass attached to it.

Right now I’m using the following code, which works for most situations:

collision.impactForceSum.y

which calculates the vertical collision forces, but doesn’t seem to take into consideration whether I’m landing on flat ground or in a downhill slope, as the collision force is pretty much the same in both cases (coming down from the same height).

Any help much appreciated, as always :slight_smile:

The field force of the WheelHit struct is the value you are looking for:

var Hit : WheelHit;
if (WheelCol.GetGroundHit(Hit))
    {
    // Hit now contains all the data on the contact

    Debug.Log("Force: " + Hit.force);
    }
else
    {
    // wheel is in the air - no force is generated.
    }    

The Hit.force value is correct even when the wheel hits the ground after being in the air. This value greatly depends on the suspension parameters (spring, damper and suspensionDistance). For instance, if suspensionDistance is very small then you’ll be likely receiving high force values as the wheel impacts the ground (hard contact).