Collision.contacts?

Is there some sort of odd order that Collision.contacts follows? Every time I use my functions, it keeps switching around and such.

What I really want to do is determine all the walkable normals the character is touching, and his surface is the average of all those normals. I know the average would require Lerping, but what of the normals he's standing on? How could I go about reading those fluently?

recommand

  1. use unity help

  2. sample raycast

RaycastHit hit;

if(Physics.Raycast(rigidbody.position, Vector3.down, out hit))

3.OnCollision

void OnCollisionEnter(Collision collision)

{

    #region DRAW COLLISION NORMAL
    Vector3 refrectionDirection = Vector3.zero;
    foreach (ContactPoint contact in collision.contacts)
    {
        Debug.DrawRay(contact.point, contact.normal*10, Color.white);

        refrectionDirection += contact.normal;
    }

    collisions.Add(collision.contacts);
    #endregion

}

void Update() {

foreach (ContactPoint[] contacts in collisions)
    {
        foreach (ContactPoint contact in contacts)
        {
            Debug.DrawRay(contact.point, contact.normal, Color.white);
        }
    }

}