collision.relativeVelocity always zero

I’m having trouble getting relativeVelocity to show anything other than zero. The setup is somewhat simple:

The object with the rigidbody (the player) is standing still while the world moves around it. It has a Box collider which is bolted onto one of its child objects.

The object it is crashing with is travelling around a globe using transform.RotateAround, and also uses a Box collider (It does not have a rigidbody).

You’d think this would be a relatively simple setup, yet when they crash together, it triggers a collision like it should, but the relativeVelocity is always (0.0, 0.0, 0.0) (collision script is on the player root object).

Any ideas about what I’m doing wrong? Is this because I’m controlling the objects with transform instead of accelerating the rigidbody? Is there something else I could be using instead to find collision force if relativeVelocity is the wrong solution?

Good day.

Rigidbody component is the Physics compoenent, so relativeVelocity is between 2 objects will give you results if both objects have rigidbody.

If the player i colliding with a inmobile objecto, you only need to see the velocity of the polayer (the other is 0) .

But if you need to know it from 2 moving objects, you need to add Rigidbody to both objects.


Extension:

Mmm… I must say i never used it ,so i can not talk with experience…

Aaaaand if you get the 2 Vector3 velocity and calculate the relative via Mathematics??

Why you need toknow the relative? Is to calculate the “force” of the impact? Then do something like this:

Vector3 ImpactVector = Object1.velocity - Object2.velocity;
float ImpactForce = ImpactVector.magnitude;

So you have now a flaot number from the impact force.

Bye!