Isaac Adni Isaac Adni - 1 year ago 217
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 Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download