- Home /
Apply rigid body force in opposite direction of collider
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.
Answer by Lo0NuhtiK · Dec 27, 2011 at 02:49 AM
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.
Your answer
Follow this Question
Related Questions
Changing 1 parameter of rigidbody.velocity (Vector3) 2 Answers
Constrain rigidbody movement to spline at high speeds / sharp curves 3 Answers
Rigidbody object intersection 0 Answers
Elastic Collisions with Rigidbodies 1 Answer
Joystick to turn object 1 Answer