I've got two materials attached to one gameobject and what I want to do is switch from one material to another after a few seconds have gone by.
In Unity3D under the inspector menu on the Gameobject that I have selected, on the MeshRenderer heading underneath the materials sub-heading I have increased the size from 1 to 2. I've assigned two materials to the two newly created elements. But when I run the scene the materials do not switch.
public var arrayMAterial : Material[];
public var CHILDObject : Transform;
function Update() {
CHILDObject.GetComponent.<Renderer>().material = arrayMAterial[0];
}
There are no error messages. It just does not switch to the new material.
... = arrayMAterial[1];
. Also, are you using an old version of Unity just so you can use UnityScript? – Ruzihm