I have two objects colliding. I have a script in object a that I want to have add a force to object b’s rigid body based on the direction between the two. Essentially, I want object b to move away from object a when they collide, as if object a was kicking or pushing object b. I already know how to add the force with rigidbody.addForce, just not how to calculate the direction and put it into a Vector3.
Take a look at the accepted (green) answer on this page → Add force that throws object back
See if that’s what you’re looking for.