How to fade in GUI text.

So I have a few GUI.Label, and a few GUI.Styles to go with them. Since there are a few different ones to each there own settings. So how can I fade these labels in? I know the most simple way is to adjust the alpha. I did this before on fading a character renderer. I tried this with the text and the alpha isn’t accessing anything. Saying used as a property but can’t because its a type. Can someone write a simple line of code to show me how to do this correctly please?

Sorry i have updated my unity to the new UI 4.6 so i don’t remember exactly how to do it but you should first get the Gui text component then acces the color alpha.

var GuiLabel : GUIText;

GuiLabel.color.a = yourValue;


SomeGameObject.GetComponent(GUIText).color.a = yourValue;

If you are getting an error post it and post your code.

public float alpha = 1.0f;
public float fadeSpeed = 2.0f;
void OnGUI()

        if(GUI.Button(new Rect(Screen.width/2, Screen.Height/2, 200, 50))
        GUI.color = new Color(255, 255, 255, alpha);// adjust alpha value
        GUI.Label(new Rect(0, 0, 200, 50), "Label");
        //All elements to fade
        GUI.color = new Color(255, 255, 255, 1); // sets it back to 1 for another elements
IEnumerator Fade()
    alpha = 0;
    while (alpha < 1f)
        alpha += Time.deltaTime*fadeSpeed;
        yield return null;