The first one locates ok but the second causes Visual Studio error and am not sure why
Material = tickRadial.transform.FindChild("DNALinkSpheres").gameObject.GetComponent<MeshRenderer>();
Material = tickRadial.transform.FindChild("DNALinkSpheres").GetChild(0).gameObject.GetComponent<MeshRenderer>();
First, don’t write code like that.
If it has more than one dot on a line, you’re brutalizing yourself with hairy code.
How to break down hairy lines of code:
http://plbm.com/?p=248
Break it up, practice social distancing in your code, one thing per line please.
Second, Material is a type.
Now technically you CAN legally recycle that name as a variable name (eg, public Material Material;), but again, why would anyone do that to themselves?
Solved:
Renderer tempRender = tickRadial.transform.FindChild("DNALinkSpheres").GetChild(0).gameObject.GetComponent<MeshRenderer>();// = chainLink_A_Material;
tempRender.material = tickColor;
I was solving for the material anyway. This completed the execution. Now that is all I need to flip the materials in and out.