- Home /
renderer.material.lerp() doesn't work in unity
Guys,I'm using unity 4 version. I just copy and past code from unity reference to lerp the material but it isn't working; When I print current material it prints preassigned material. Is there any change in unity 4 to lerp material?
material.Lerp doesn't change the material itsself, it only Lerps between the properties of two material.
But the code does work. It should lerp between two materials at least.
No it will only animate the material properties. The object will always keep its preassigned material, by Lerping you only animate the material properties (color, specular color, shininess, ...)
What you're trying to achieve is probably a smooth transition between two totally different materials. That will require a custom material with support for that kind of effect.
Just remember that material.Lerp only changes stuff like color, shininess, ... The assigned material of the object doesn't change.
The unity docs imply that you can though,
http://docs.unity3d.com/Documentation//ScriptReference/$$anonymous$$aterial.Lerp.html
Answer by Paulius-Liekis · Nov 28, 2012 at 09:45 AM
Lerp only interpolates properties of the material. Nothing else.
Your answer
Follow this Question
Related Questions
Burning Effect Lerp Not werking 2 Answers
how to switch material with script? 1 Answer
change material rendering mode, but don't update material seems in scene at runtime 2 Answers
Material.Lerp for transparent spec material with two different textures 2 Answers
Lerp material opaque to transparent 1 Answer