Temporary GUI image help?

I have made a simple image logo for my game I am making in Unity 3D.

Basically, I am a beginner in Unity, and I am trying to find a way to display a image on part of the screen, for like 5 seconds, then fade out.

May anyone help me, please?



Select the desired texture in the Project view, then press the button Create in the Hierarchy view and select GUITexture: a GUITexture with your image will be created. Add the following script to it:

var alpha: float = 6; // 5 seconds + 1 second fade out

function Update () {
	alpha -= Time.deltaTime; // decrement timer
	guiTexture.color.a = Mathf.Clamp01(alpha); // set GUI alpha
	if (alpha < 0) Destroy(gameObject); // suicides when totally invisible

The variable alpha starts with the value 6, and is decremented each frame. It’s value clamped to the 0…1 range is assigned to the GUI alpha, thus when it’s becoming lower than 1 the image starts to vanish. When alpha gets lower than zero, the image is completely invisible and is destroyed.