Make a list of gameObject's child by name

How do I get the count of childs with a desired name of a gameObject?

Basically what I’m trying to do would be a childCount but to only count the childs with the name I want

is this possble to achieve? I need it to update live so if a child gets destroyed the number decreases and if I add one, the number increases. So making an int variable and add +1 to it for each child with name wouldnt work because if I destroy one, it wont decrease te value.

You can use Transform.childCount and Transform.GetChild , or a foreach to iterate through a transform’s children. e.g.

    foreach (Transform child in transform) {
      if (child.name == "SomeObjectName")
      {
         // do something on children named SomeObjectName
      }

    }