Collider passing through

I know there is 1 way for colliders to pass through is Physics.IgnoreCollision(collider1, collider2).

My Physics.IgnoreCollision(collider1, collider2) code is in parent script with 3 childs. I want each child to ignore each other’s (same parent) collider. For example, player 1 ignore player 2, player 2 ignore player 3, etc.

I tried

foreach (Transform child in players)
			for (int i = 0; i < 3; i++)
				Physics.IgnoreCollision (child*.collider, child[i+1].collider);*
  •  }*

but I get this error:
Cannot apply indexing with [] to an expression of type `UnityEngine.Transform
And I tried Physics.IgnoreCollision (child.collider, child.collider); but error says they are the same collider.
How do I get player 1 ignore player 2 collider under the same parent?

Assuming players is the transform that contains the children you want to ignore:

for (int i = 0; i < players.childCount; i++) {
    for (int j = i+1; j < players.childCount; j++) {
        Physics.IgnoreCollision(players.GetChild(i).collider, players.GetChild(j).collider);