Apply Vector3.zero to 1/3 ChildObjects of Parent; Upon Collision

Hi, I know how to access child objects of a parent, but I do not know how to apply Vector3.zero to the children that Have Not Collided!

public class Collisions : MonoBehaviour {

    private void OnCollisionEnter(Collision col) {

        ContactPoint contact = col.contacts[0];
        Vector3 CollisionPoint = contact.point;

        if (transform.childCount > 1) {

            Transform[ ] ChildrenTransform = transform.GetComponentsInChildren(typeof(Transform)) as Transform[ ];

            foreach (Transform t in ChildrenTransform) {
                t.rigidbody.velocity = Vector3.zero;
            }
        }
    }
 }

I don's know if it's your only bug, but GetComponentsInChildren returns Component[] not Transform[], casting it as such will cause it to be null

Instead, try this:

foreach (Transform t in GetComponentsInChildren<Transform>()) {
    t.rigidbody.velocity = Vector3.zero;
}

Uses the generic version of GetComponentsInChildren (which you could use in your own code to stop the null reference exception), though changed the semantics somewhat - now it'll do it to all children, not just if there is only 2 or more children in the collided object