Hi i need little help. I have this script:
Transform hex;
public Material Dirt;
public Renderer[] childColors;
public void Start()
{
}
void OnTriggerEnter(Collider other)
{
if (other.gameObject.tag == "Grass")
{
//MeshRenderer childColors = other.GetComponentInChildren<MeshRenderer>();
//hex = other.transform.GetChild(0).GetChild(0);
foreach (Renderer color in childColors)
{
color.material = Dirt;
}
}
}