Hi all -
I would like to obtain collision information (i.e. contact points, normals) for a collision between two colliders. I was happy to see that this info is already present in the Collision class, which I can access from the OnCollisionEnter() function. However, I need this information for "Trigger-like" objects that should not literally be colliding and bouncing off of each other.
The logical thing to do would be to make my objects Triggers and use the OnTriggerEnter() function. However, the OnTriggerFunction does not provide collision information like OnCollisionEnter does. (Not sure why this choice was made for the scripting API - I think it would have made more sense to give these two functions parallel behavior, but never mind.)
So it looks like the only way I can get the collision information I need is to use OnCollisionEnter(), but this only works when at least one of my objects is a NON-kinematic rigid body. So whenever it collides with another object it bounces off and flies away - not the behavior I need.
I have been trolling the community for a while now in search of an answer to this question, but no luck so far.
http://forum.unity3d.com/threads/33091-SOLVED-Collision-detection-without-physics
http://answers.unity3d.com/questions/9050/how-do-i-detect-a-collision-without-affecting-the.html
http://answers.unity3d.com/questions/42933/how-to-find-the-point-of-contact-with-the-function.html
http://answers.unity3d.com/questions/139560/how-to-get-the-collider-point.html
http://answers.unity3d.com/questions/26053/how-to-figure-out-the-contact-point-of-ontriggeren.html
http://answers.unity3d.com/questions/31810/collision-detection-without-a-rigidbody.html
Each of these "solutions" either makes the objects into Triggers (thereby denying me access to the information I need), making one of the rigidbodies Kinematic (which prevents OnCollisionEnter() from ever firing), or by using Physics.IgnoreCollision() (which also, obviously, prevents a collision from firing).
Am I SOL, or is there a way to get collision information from Trigger-like objects?
Thanks so much
↧