The second script doesn't show UI elements

So I have two scripts both attached to main camera. First one is responsible for adding players and launching the game - the second script. Second script disables the first script and is supposed to have buttons of it’s own. But they do not appear on the screen.

here’s the code of second script:

var winningScore: int = 20;
private var score1 : int; // score of Player1
private var score2 : int;
private var score3 : int;
private var score4 : int;
private var score5 : int;
private var score6 : int;
private var preScore : int; // total score of each turn before it is banked and added to players score. This should be reset at the begining of each turn.
private var turns : int = 1;
private var players : int;
private var activePlayer : int = 1;
private var playersInGame : int;

function Start (){
	gameObject.GetComponent("InstantiatePlayers").enabled = false;
	
	for (var go : GameObject in GameObject.FindGameObjectsWithTag ("Player")){
		playersInGame++;
	}
	print ("this games has " + playersInGame + " players.");
}

function onGUI (){
	if (GUI.Button (Rect(10,40,100,30),"Bank")){
		turns++;
		activePlayer = turns%playersInGame;
	}
}

I know that GUILayer on Main Camera is still active because it shows player scores (scripts attached to player prefabs).

is there some general rule?

If you copypasted your code then the problem is in your “onGUI”. Change it to “OnGUI” :wink: