Hi,
i use onCollisionStay() to copy the contactPoints into another variable which i then use in update to calculate angles and some other things.
But i always miss ‘some’ points. Atleast i’m sure i miss 1 point, but in my case it’s the most important one. When i Debug.DrawRay() from within OnCollisionStay everything is there. But when i use the collisionPoints[ ] (‘cons’ in my example) (which is just a copy of Collision.Contacts) and DrawRay() some points are missing.
Why?
Thanks.
void OnCollisionStay(Collision col) {
foreach(ContactPoint c in col) {
Debug.DrawRay(c.point, c.normal); //works
}
cons = col.contacts; //see below
}
void OnCollisionExit() {
cons = new ContactPoint[0];
}
ContactPoint[] cons = new ContactPoint[0];
void Update() {
foreach(ContactPoint c in cons) {
Debug.DrawRay(c.point, c.normal); //missing atleast one important point
}
}
typed that out of my head, a typo should not be the cause.