- Home /
Finding the time of impact or penetration distance of a collision in Physics2D
I have two RigidBody2D's, one Dynamic, one Kinematic. Each has it's own PolygonCollider2D, and when they collide I disable the physics on the Dynamic one, and parent the whole GameObject to the other(amoung other things). This can happen multiple times, so the end result is one GameObject with Kinematic physics containing a bunch of other child GameObejcts.
The problem is that when the Kinematic body moves quickly, the Dynamic bodies become lodged inside by varying amounts instead of just touching along the edges. Is there a way I can find the exact time of impact of the collision, rather than just the frame that it occured on? Or the distance the objects have penetrated each other?
Alternatively, if there's a separate way to resolve physics collisions before I remove physics objects, I'd be happy with that, getting the exact time of impact just seemed the most simple.
Thanks
Your answer
Follow this Question
Related Questions
RigidBody2D.MoveRotation() Custom Pivot 0 Answers
Move 2 rigidbodies together, but allow one to slide off 1 Answer
What is the best way to implement physic simulation prediction for AI in Unity? 1 Answer
Why the OnMouseDown() event on Rigidbody does not fire? 0 Answers
I'm so lost trying to add a force towards the nearest collder with tag "x" 0 Answers