I am a newb at coding and i dont know how to add a press the button to cuntinue to next level type thing.
HELP
#pragma strict
import UnityEngine.UI;
var textToUse = "Text";
var text : Text;
var levelload : boolean;
function Start ()
{
text.text = "";
}
function OnTriggerEnter2D(other: Collider2D) {
text.text = "" + textToUse;
levelload = true;
if(Input.GetKeyDown"e"){
Application.LoadLevel("garage"); // it number or name, string
}
}
function OnTriggerExit2D(other: Collider2D) {
text.text = "";
levelload = false;
}