Get all child not working?

Hi,
For some reasons I can’t get this to work properly… can someone explain to me why it isn’t working, in JS?
function Start()

{
 
    for (var child : Transform in transform)
 
    {
 
        child.rigidbody.isKinematic = true;
        child.collider.enabled = false;
 
    }
 
}

thanks!

That’s probably because your code only lists direct children, not children of children.

You may want to use GetComponentsInChildren(Rigidbody) get get all Rigidbody components in any of the childs