I have a code. Just finding in children objects with name contains “something” .And it works fine, but after SetActive(false) all members of array become none
Transform[] chlds;
chlds=transform.GetComponentsInChildren<Transform>();
int woodCnt=0;
foreach( Transform ths in chlds)
{
if (ths.name.Contains("wood"))
{
wood[woodCnt]=ths.gameObject;
wood[woodCnt].SetActive(false);
woodCnt++;
}