In UnityScript, why does GUI not get called within hit on collider?

I’m trying to print out text when a user touches a sprite, however, even though I get no errors when building and running the code, the code refuses to printout the text and I cannot understand what I am doing wrong. Please help me understand why it does not print.
It prints the debug text when I touch the sprite, but not the GUI text with total.

This is the code:

#pragma strict

function Start () {


function OnGUI(){
//var total = 0;

	//GUI.Label( myRect, total.ToString() ); // Displays "10".
    //GUI.Label( myRect, "" + bullets ); // Displays "10".
   // GUI.Label(Rect(0,0,Screen.width,Screen.height),"Total:"+total);
//function Update () {

var platform : RuntimePlatform = Application.platform;

function Update(){

    if(platform == RuntimePlatform.Android || platform == RuntimePlatform.IPhonePlayer){
       if(Input.touchCount > 0) {
         if(Input.GetTouch(0).phase == TouchPhase.Began){
    }else if(platform == RuntimePlatform.WindowsEditor){
       if(Input.GetMouseButtonDown(0)) {
function checkTouch(pos){
var total = 0;

    var wp : Vector3 = Camera.main.ScreenToWorldPoint(pos);
    var touchPos : Vector2 = new Vector2(wp.x, wp.y);
    var hit = Physics2D.OverlapPoint(touchPos);
      //total = total +1;

If I’m not mistaken you should display GUI elements only in OnGUI but not in Update.
Move GUI.Label… to OnGUI and just assign the text you want to display in your “touch detection” function to a global variable which you’ll access then from OnGUI