So everything is working but I don’t understand how this bit is actually working:
foreach (Transform child in transform)
{
child.gameObject.SetActive(shouldShow)
}
How does the foreach loop know you want to iterate over the children in the Transform? How does it know that transform
is not just an object?