I’m trying to change the second material in all objects in my array. I’m currently using
for (var i = 0; i < structure.Length; i += 1)
{
structure[i].GetComponent<Renderer>().material = mats[0];
}
This only changes the first material but I want it to change the second. When I do:
for (var i = 0; i < structure.Length; i += 1)
{
structure[i].GetComponent<Renderer>().material[1] = mats[0];
}
I get an error. Does anyone have any ideas? I saw online someone said do render.material[1] but I don’t know how to make that work in the current code I have.