When I run this code, the alpha does not change either visually or in the inspector until it hits 0, and then the sprite disappears and shows the alpha as 0 in the inspector.
When I use Debug.Log() in the code, however, it reveals that the alpha is indeed changing the entire time.
I’ve already tried new Color() too.
public class Class: Monobehaviour {
// This is set
public TextMeshProUGUI textToFade;
void Update()
{
// If there is a text to fade
if (textToFade != null)
{
textToFade.alpha -= 1;
if (textToFade.alpha <= 0)
{
textToFade = null;
}
}
}