Collision has no contacts?

For some reason (and I’ve looked around for answers to this), the collision I receive with OnCollisionEnter does not always have any contact points. Once every 20ish collisions or so the array will simply be empty. I’ve had to check every single time whether the contacts array length is equal to zero to prevent out of range errors. How is this possible?

1 Like

I don’t work very commonly with this collision enter events, so I don’t know why this can happen… here is a possible solution:

if (myArray <= 0)
    return;

I hope it can be usefull for you!
PS: Sorry for my bad english…

Yea that’s what I’m currently doing. I’m just worried that this will have consequences because I’m essentially ignoring a collision.

That sounds like a strange bug… are there any gaps in the mesh of eithe collider perhaps? I can’t think why else there would be a “collision” but no collision points.

If you can administrate good the code and you know what every part of your script does you don’t have to get errors.
Unity has got a LOT of this funky bugs, and usually this kind of solutions are the unique what works…
You can ask to a developer of Unity and see what he says. Sorry but I can’t do a lot more here…
I hope I be helpfull!