- Home /
How do I use an animation to change the materials on a multi-material mesh renderer?
I have successfully managed to setup an animation to change the material on a single-material mesh renderer. I just "Add Curve" then select Mesh Renderer|Material Reference[0].
But now I have a renderer with a size-3 materials array, and while I can find Material Reference[0-2] in the "Add Curve" list, actually setting these values from the animation seems to often change an unexpected slot in the materials list. (In particular things seem to change Material 0 often even when they're listed as [1] and [2]
Is there some more correct way to change these materials? Can I simply not change materials this way via an animation? Is there possibly a bug in Unity animations here?
Answer by Michael-Thomas · Oct 15, 2014 at 05:45 PM
The Unity dev team has accepted this as a bug, although no promises on resolution date. (Currently I've verified it is still broken in 4.6b19)
Hi @$$anonymous$$ichael-$$anonymous$$,
I know this is old question but was wondering if this had been fixed. I'm running Unity 5.2.3f1 and still can't seem to specific a specific material to animate on a multi-material mesh.
I ended up using a script ins$$anonymous$$d of an animation to manipulate the materials. I'm pretty certain I saw a changelog that implied this issue had been addressed but I haven't tried it since 4.6.
Your answer
