OnCollisionEnter contacts provides information where the rigidbody collided on an object. How do I figure out the contact points of where the rigidbody was hit and not the object that the rigidbody hit. Is this available? or can I only get collision data from the colliders without the collsionEnter script?
Essentially… I need to be able to determine where the player is getting hit…
front… rear… top… bottom… etc…
OnCollisionEnter comes with a parameter - a Collision object.
Collision.contacts is an array of ContactPoints, which should have the information you want.
is all the contact points involved in the collision
is the point of impact
is the perpendicular normal of the impact (if it’s “upwards” the impact came from above etc.)
Thanks for the replies. Unfortunately, contact normal doesn’t supply normals for the rigidbody that is recording the collision. And the information obtained from the contact normals of the other object is unreliable when used with non orthogonal shapes to determine contact normals for a rigidbody.