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;
}
}
}
}