- Home /
LoadLevel to menu error
Hy! I have problem with LoadLevel back to menu. I have only 1 level. And on the end of level i want load back to menu When i start game menu work as well. But when i have score 2 load me back to scene "menu" but button to start level dont work anymore.
I have script:
public var kuna:int;
static var score:int=0;
private var textfield:GUIText;
function Update(){
if (score==2){ Application.LoadLevel("menu"); } }
function OnTriggerEnter (other : Collider ) { if (other.tag =="kuna") { Destroy (other.gameObject); score+=1; } }
function OnGUI (){ GUI.Box (Rect (0,0,150,60),""); GUI.Label (Rect (10,5,100,50),"Pokupljeno kuna:" + score); } Here is link to game: http://crokamagra.com/zavrsna/dada/WebPlayer.html
Your answer
Follow this Question
Related Questions
Inspector scripting, adding lists, checkboxes and buttons [With Image] 0 Answers
Change to scene based on current scene 1 Answer
Main Menu button in pause menu 0 Answers
Loading scene from WP8 menu 1 Answer
Back and Menu button on the device 2 Answers