using UnityEngine; using System.Collections.Generic; using System.Linq; public static class Helper { public static GameObject[] GetTaggedChildren(GameObject parent, string tag) { List childrenWithTag = new List(); foreach (Transform child in parent.transform) { if (child.CompareTag(tag)) { childrenWithTag.Add(child.gameObject); } } return childrenWithTag.ToArray(); } }