I am a beginner C# coder, and I am trying to make a game in Unity. Hence the question: Can I check if all children of an object are active in a scene? I want to use it to check if all enemies are active.
You could check using:
for (int i = 0; i< gameObject.transform.childCount; i++)
{
if(!gameoObject.transform.GetChild(i).gameObject.activeInHierarchy)
{
return false;
}
}
return true;
activeInHierarchy
is exactly what you need.