Get hit direction from one gameObject hitting another

If I fire a gun (bullet) I use a ray cast (Ray.direction) to get the direction the ray was hitting the rigid body to add force.

impactTarget = hit.rigidbody;
impact = ray.direction * 12;

I then add force to the rigid body thats been hit with

impactTarget.AddForce(impact,ForceMode.VelocityChange);

And all works well with the bullet because it’s instant, if I use the Ray.direction for the RPG by the time it’s reached the target the ray cast could be looking somewhere else.

But how if I shoot a RPG (gameObject with small box collider) and hit the same rigid body do I get the direction of the RPG hitting from.

ImpactTarget = contact.gameObject.rigidbody;
impact = contact.??

I’m using for the collision detection

function OnCollisionEnter(collision : Collision){

	var contact = collision.contacts[0];

Thanks.

The “direction” between any two objects is simply the difference between their transform positions.

var Direction : Vector3 = contact.transform.position - transform.position;

You may then want to normalise this variable - it’s unclear from your question exactly what you want it for.

You can simply find object(game object with small box collider) by Gameobject.findbytag and
the difference between the found object vector.position and impacttarget.position will give you direction .