# Unity physics impulse fundamentally incorrect

If I place a plane at 0,0,0 and a cube on top of it, and the physics has no bounce for either object, then the impulse should be 0. This is because impulse for a mass that does not change over time is equal to the mass * the change in velocity.

Reference:

Impulse = mass * change in velocity

You can see relative velocity is 0, yet the impulse is 0,.2,0!

This is causing me problems because I am trying to place objects on a surface and I use impulse to detect damage. So my objects explode on placement.

Thereâs nothing wrong. An impulse is also a change in the momentum, that is, a force applied during a finite time.

This is whatâs going on here:

• Gravity is pushing the cube downwards.
• The cube collides with the plane and you receive the OnCollision event (you wouldnât be receiving such event if you set Use Gravity to false).
• The collision is resolved by applying an impulse to the cube for counter-acting the action of the gravity. This is the collision.impulse value youâre showing at the log.

Take this formula from your reference:

F â˘ t = m â˘ âv

The impulse is the right part of the equal sign, that is m â˘ âv, thus:

F â˘ t = collision.impulse

So you can get the actual force by dividing the impulse by the delta time:

F = collision.impulse / t

If you debug collision.impulse with more decimals you will see that the value is not 0.2, but exactly 0.1962. Try this:

Debug.Log(âcollision.impulse=â + collision.impulse.ToString(â0.00000â));

The time the impulse is applied is the fixed delta time. Thus:

F = collision.impulse / Time.fixedDeltaTime;

If you do the above calculation the force will result 0.1962 / 0.02 = 9.81 exactly. This is the force required for keeping a cube of 1 Kg static on top of a plane with gravity 9.81 m/s2.

So the impulse value youâre seeing is actually the physics system resolving the collision using an impulse (a force applied during a finite time).

Also, collision.relativeVelocity is just that: the relative velocity of the colliding bodies at the time of the collision. Thereâs no direct relationship with the impulse. One of the bodies may be stopped while the other is moving, yet the relative velocity still would show that difference.

2 Likes