public static class TransformExtensions{ public static GameObject FindChild(this Transform transform, string name){ if (transform.childCount == 0) return null; Queue<Transform> childs = new Queue<Transform>(); for (int i = 0; i < transform.childCount; i++){ childs.Enqueue(transform.GetChild(i)); } Transform current; while(childs.Count != 0){ current = childs.Dequeue(); if (current.gameObject.name.Equals(name)) return current.gameObject; if (current.childCount == 0) continue; for (int i = 0; i < current.childCount; i++){ childs.Enqueue(current.GetChild(i)); }} return null; } }