# Force Applied to Rigidbody

I want to know how much damage is taken by a Rigidbody on impact, to do so It is a common practice to use RELATIVEVELOCITY OnCollisionEnter.

But what if I have the following example (attatched image file).
Rigidbodies A and B should take more damage than C, and I can’t use relative velocity because is 0.

I would like to find a very flexible solution (i.e. not an upwards raycast to sum mass) to know how much damage is receiving every object on impact.

First, there’s a forum just for physics in Unity, so you should use that forum for these kinds of questions in the future.

You should at the ‘impulse’ property of the collision. It represents how much force is actually generated by the collision, taking into account the mass of objects, and the actual simulation.

Note that OnCollisionEnter likely won’t work on its own for your purposes, because you’ll miss any forces being applied to objects that are already touching. In your example, if the sphere struck the red block, you probably wouldn’t get an OnCollisionEnter event involving block “A”, because block “A” was already touching the red block. So you’ll probably want to also be handling OnCollisionStay, which will give you additional force applied to a stack of objects that were already touching.

Collision2D doesn’t have Impulse property

Okay. Well, you said OnCollisionEnter earlier, not OnCollisionEnter2D…

2D physics is a completely different API in Unity, and not as full-features (it seems) as 3D/PhysX physics. I don’t know how to achieve what you’re trying to do in 2D. It might seem like a lame solution, but an approach you could take is to build your game/project in 3D with some position constraints added to the rigidbodies, along with the camera constraints to make it look more 2D, if you need an improved physics simulation. Or see if the asset store has some 2D physics replacement.

Thank you for the quick answer. But I cant contemplate to change my game in fake-2D at this point.
Hope that there exists a solution for that simple problem in 2D.