- Home /
This question was
closed Oct 16, 2015 at 09:04 AM by
paco morales for the following reason:
Other
Question by
paco morales · Oct 15, 2015 at 09:49 PM ·
androidunity 5lerpcolor change
Control time transition between colors
Hi,
Please help, I have problems trying to fix this script...
I want to change the color of the material and I want to control the time of transitions between colors.
Now I can change the Color without problems, but now I want to smooth the transition between colors.
Please any advice is more than welcome.
var fadeSpeed : float = 7.5;
var NextColors : Color[];
var NextMaterial : int = 0;
function NextMaterialUsed()
{
GetComponent.<Renderer>().material.color = Mathf.Lerp(GetComponent.<Renderer>().NextColors[NextMaterial],.material.color,Time.deltaTime * fadeSpeed);
if(NextMaterial < NextColors.length-1)
NextMaterial += 1;
else
NextMaterial = 0;
}
Comment
Follow this Question
Related Questions
smoothly switch between 2 colors that are using lerp 2 Answers
Image material on an object plays in Unity Editor but in Android it doesn’t 0 Answers
Unity 5.6.0f1 Does not support Nougat 7+ ? Google Console lists Nougat 7+ as unsupported on my apks. 0 Answers
I need help with Vectors, Positions, Rigidbody2d and Lerp. Please help me! 0 Answers