I’ve been struggling with this issue for some time now. I simply want a lerp between the alpha of an image (from 0 to 1), but the transition never completes, no matter where I execute the lerp. Here is a simplified version of what I’m trying :
public Image redUI;
public bool hit;
Color alphaZero = new Color(1f, 1f, 1f, 0f);
Color alpha = new Color(1f, 1f, 1f, 1f);
void FixedUpdate () {
if(hit)
{
redUI.color = Color.Lerp(alphaZero, alpha, .2f);
}
}
No matter what value I put in the “t” of the lerp no transition ever happens. And the hit boolean stays true for long enough to let the interpolation happen.
Thank you for the reply, I’ll try this out tomorrow. What I find weird is that I’ve never needed to gradually increase the value of “t” in order for the lerp to work in other situations using Vector3.Lerp or Mathf.Lerp, hence my confusion at first. But I might be wrong, I’ll take another look at my documentation.