My simple button doesn't seem to work.

Hi, I’ve been spending my last 30 minutes trying to make this work. Can you tell me what’s wrong with it?

function OnGUI () {
    		
    	if (GUI.Button (Rect (Screen.width*7/16, Screen.height*2/16, Screen.width/6, Screen.height/8), "Stand Up!", standUpButton)) {
    			hitCount ++;
    		}
}

I am watching hitCount values with debug but it doesn’t change.

Hmm, when I add this code (cut/pasted from above), it seems to be working fine for me:

    function OnGUI () {
     
            if (GUI.Button (Rect (Screen.width*7/16, Screen.height*2/16, Screen.width/6, Screen.height/8), "Stand Up!")) {
                 hitCount ++;
                 Debug.Log(hitCount);
           }
    }

Are you sure that you are declaring hitCount with the correct scope (class variable scope)? I deleted your style since I don’t have it, so try removing that. Maybe that is part of the problem (although I’m not sure how it could be).