Calculating speed of an object

I have a car chase scene. When a your car slams into another car, I need the car to go flying in the direction it was slammed in. I don’t know how to calculate the speed it hits. I do know how to use the .AddForce but I do not know how to tell what direction it gets hit in.

First you have to mention if you want to use physics or not and be sure that u dont want unity physics to take care of the collision.

If you are on your own there are 2 ways 1st applies if you have rigidbody component:
in this case You can have movement direction of an object by using rigidbody.velocity which is a Vector3 if you want to act physically correct you can do the math and calculate the velocity you need to add to the other object by thiss rule: mass1Velocity1=mass2Velocity2 so the code will be:

var veloc1: float; // magnitude of this object's velocity
var veloc2: float; // magnitude of velocity to be applied
var object2: Rigidbody; // rigidbody of the second object

var velocVector :Vector3; // vector of this object's direction

function Hit(){
veloc1 = rigidbody.velocity.magnitude;
veloc2 = rigidbody.mass * veloc1 / object2.mass;
velocVector = rigidbody.velocity.Normalize(); //returns a Vector3 with a magnitude of 1(just the direction)

object2.velocity = veloc2 * velocVector; // adds physically correct velocity to 2nd object


i personally used this method with a Trigger when an arrow hit an object and stuck to that ,there I couldn’t use colliders as they had incorrect behaviour

next situation is when you do not use physics and rigidbodies, then I think you have to calculate velocity of your object using Update function.

hope that helps. comment if there was still a problem.