Hello,
I have a simple script that changes the elements of a object. What is wrong this the following?
children.GetComponent<Renderer>().materials[0] = mat;
children.GetComponent<Renderer>().materials[1] = mat2;
The above doesn’t change any mats nor does it throw an error. The blow does indeed work.
children.GetComponent<Renderer>().material = mat;
I’ve looked around the internet on a fix but I couldn’t find anything that works.
Thanks.