Isaac Adni Isaac Adni - 1 month ago 28
C# Question

Fade out Unity UI text

When I run the following code on my UI text

Color color = text.color;
color.a -= 1.0f;
text.color = color;


The alpha value of the text is immediately set to 0. How can I simply fade out the text.

Answer

Use Color.Lerp (text.color, Color.clear, fadeSpeed * Time.deltaTime);

Comments