- Home /
Collision with no contact?
I just received an OnCollisionEnter(), but the Collision's contacts array has a length of zero. Is this... normal? Up until now I've always used contacts[0] without checking, and I haven't seen any code sample check either.
So, what's up with this empty contacts array? And should I always check its length before using contacts[0] ?
Answer by Iamdain · Nov 23, 2013 at 09:25 AM
Same issue here http://forum.unity3d.com/threads/189556-Collision-triggered-but-no-contact
can't find solution...
Answer by MadNukin · Apr 30, 2018 at 02:41 PM
You should create your array like so:
var contacts = new ContactPoint2D[] {new ContactPoint2D()};
Hope this helps to feature trouble makers.
Your answer
Follow this Question
Related Questions
Normal of collision hit is moving downwards 0 Answers
Position of a Collision 1 Answer
OnCollisionEnter not working 2 Answers
How do I find the point of contact on a box collider? 1 Answer