Can you use exchanged momentum in a collision script?

The physics engine clearly understands momentum, but I can’t find any scripting component to call as a variable during a collision. I’ve got a kinematic rigidbody that I want to “damage” based of the strength of the collision, but I don’t want to move it. I’ve tried using relative velocity, and that produces weird results when the collision skims the edge instead of hitting head on, so that’s out.

Turns out you can, with coll being the collision, coll.relativeVelocity returns the velocity the moment of impact, while coll.rigidbody.velocity returns the velocity the moment after impact, allowing you to find the change in velocity, which leads to the change in momentum, assuming the target you’re calling the function from is kinematic.

momemtumY = (coll.relativeVelocity.y - Math.Abs(coll.rigidbody.velocity.y) * coll.rigidbody.mass);
momemtumX = (coll.relativeVelocity.x - Math.Abs(coll.rigidbody.velocity.x) * coll.rigidbody.mass);
momentum = (float)Math.Sqrt(Math.Pow(momemtumY,2) + Math.Pow(momemtumX,2));