On rare circumstances, when my controller hits a jumping target I’m getting an
IndexOutOfRangeException: Array index is out of range.
error on the following code
private void OnCollisionStay(Collision collision)
{
var contacts = collision.contacts;
_contactNormal = contacts[0].normal; // this line
}
and I don’t really see how this is possible.
If OnCollisionStay is called, then I assume there should always be collision, therefore I have to be in contact with something.
Obviously I can fixed this by checking for the value, but really want to know if this is just a bug or is there chance under certain circumstances that this could occur.
Cheers