I am trying to set the material of child game objects with little success.
The hierarchy is this:
ArticlePaper (this is the parent)
ArticlePaper (this is a child)
ArticlePaper (this is a child)
So what I need to do is update the material for the children NOT the parent but whatever I try I either get just one changed or as this below none?:
foreach(Transform t in current.transform) {
List<Material> currentMats = new List<Material>();
currentMats.Add(plainMaterial);
t.Find(current.gameObject.name).GetComponent<Renderer> ().materials = currentMats.ToArray();
}