GUI will not update

I have added collectibles into the game that I am making and created a script to show the amount of collectibles left to collect, however it shows how many there are when the scene starts but does not update when they have been collected. The code for collecting is:

function OnTriggerEnter(Collection : Collider){

if(Collection.gameObject.name == "Character"){
	
	Debug.Log("Collected");
	Destroy(gameObject);
	
}

}

and the code to create the GUI is:

   var collect : GameObject[];


collect = GameObject.FindGameObjectsWithTag("Collectible");


function OnGUI(){
	
	GUI.Label (Rect (10, 10, 100, 20),"Collected: " + collect.length);

}

Can anyone tell me how to get the GUI to update when the objects have been collected?

You can create a static variable on the script of the Collision function

this goes on the player as Player.js

    static var count;

This goes on the player too

function OnTriggerEnter(other : Collider){       
        if(other.gameObject.name == "Collectible"){
          Debug.Log("Collected");
          count += 1;
          Destroy(other.gameObject);
    }
}

for the Gui:

  var collect : GameObject[];
    collect = GameObject.FindGameObjectsWithTag("Collectible");
 
    function OnGUI(){
        var col = collect.Lenght-Player.count;
        GUI.Label (Rect (10, 10, 100, 20),"Collected: " + col);
    
    }

Scriptname you will have guesses is the name of the script holding the count variable.

Edit:I change a couple of details as it was not so clear actually…