GUI Texture only appear once

Hi guys, I’m currently facing some problems with my assignment. It would be great if any of you could help. In the game, the player is able to pick up 3 items and whenever he picks up one, a GUI Texture will appear on the screen to notify the player that he got the item. However, the GUI Texture only appears once and when the player proceeds to pick up the other two, the GUI Texture did not appear.

Below is what i have: (Updated Script)

var Picked : AudioClip;
var showGUI = false;
var first : Texture2D;
var color : Color;

function OnControllerColliderHit(hit:ControllerColliderHit) {   
        if(hit.gameObject.tag == ("Pickable")) {  
        	showGUI = true;
        	audio.PlayOneShot(Picked); 
            Destroy (hit.gameObject);
        }
}
    
function Start()
{
    color = Color.white;
    yield FadeOutAfterTime(5);
}
    
function OnGUI () {
	if (showGUI) {
		GUI.color = color;
		GUI.DrawTexture (Rect (450,175,375,250), first, ScaleMode.ScaleToFit, true);
	}	
}

function FadeOutAfterTime(time : float)
{
    yield WaitForSeconds(time);
    yield Fade();
    showGUI = false;
    color.a = 1;
}


function Fade()
{
   while (color.a > 0)
   { 
       color.a -= Time.deltaTime;
       yield;
   }
}

All 3 of my items had been tagged “Pickable” so it really baffles me why this script could not work.
However, I was wondering if the reason why the GUI Texture only appears once is because of the fade effect?
Could anyone enlighten me? Thanks in advance.

EDITED:
It seems that showGUI = false and color.a = 1 must stick together or the second texture would not appear.
Thanks in advance!

It won’t show a GUITexture more than once because of:

A. showGUI is set to true after a collision, but never set to false again.

B. You are fading the alpha(a) to 0(making it invisible), but you are never making it visible again.

You will need to/could do:

A. set showGUI to true after fading the alpha value

B. and you will need to set the alpha value back to 1 in order for it to be visible.

Need help? Just ask.

EDIT:

var Picked : AudioClip;
var showGUI = false;
var first : Texture2D;
var color : Color;

function OnControllerColliderHit(hit:ControllerColliderHit) {   
        if(hit.gameObject.tag == ("Pickable")) {  
            showGUI = true;
            audio.PlayOneShot(Picked); 
            Destroy (hit.gameObject);
        }
}

function Start()
{
    color = Color.white;
    yield FadeOutAfterTime(5);
}

function OnGUI () {
    if (showGUI) {
       GUI.color = color;
       GUI.DrawTexture (Rect (450,175,375,250), first, ScaleMode.ScaleToFit, true);  
    }
}

function FadeOutAfterTime(time : float)
{
    yield WaitForSeconds(time);
    yield Fade();
}

function Fade()
{
   while (color.a > 0)
   { 
       color.a -= Time.deltaTime;
       yield;
       showGUI = false;
       color.a = 1;
   }
}

I just sat showGUI to false and after that I sat the alpha value back to 1.

It is not exactly bulletproof and considering it is a assignment, I will just give you an example. There may be some limitations using this method, but I think you get the point.