Hi,
I am trying to assign the colour assigned to the child NewZealand to the two children in it. Following is the screenshot of the hierarchy,
I am using the following script to assign the colour,
string htmlValue = country_color[(index)];
Color newCol;
if (ColorUtility.TryParseHtmlString(htmlValue, out newCol))
{
countryGameObject.GetComponent<Renderer> ().material.color = newCol;
}
However, the script changes the colour of only the outside object (NewZealand) and not the two objects in it. Is there any way to do it?
Thanks.,Hello,
I have a child containing 2 children in it.
When I run the following script to change the colour it changes the colour of NewZealand but not the 2 objects in it.
string htmlValue = country_color[(index)];
Color newCol;
if (ColorUtility.TryParseHtmlString(htmlValue, out newCol))
{
countryGameObject.GetComponent<Renderer> ().material.color = newCol;
}
Thanks in advance for the help.