public void UpdatePulseControllers(GameObject obj) { //If the object does not match the correct parrent then we need to ignore it if (!treePattern.IsMatch(obj.name)) { Debug.LogWarning(obj.name + ": Name does not match the format for a tree."); return; } Debug.Log("Adding " + obj.name + " to " + treePattern.Match(obj.name).Value + "_"); //Get the PulseController from the origin tree PulseController pC = GameObject.Find(treePattern.Match(obj.name).Value + "_").GetComponent <PulseController>(); pC.Add(obj); }