Hey so have a small problem, my game won’t enter the next level after I press the key specified and when I’m in the OnTriggerEnter
var enter : boolean;
function update(){
if(enter == true){
if(Input.GetKeyDown("e")){
Application.LoadLevel(0);
}
}
}
function OnTriggerEnter(col : Collider){
if(col.gameObject.tag == "Player"){
(enter) = true;
}
}
function OnTriggerExit(col : Collider){
if(col.gameObject.tag == "Player"){
(enter) = false;
}
}
function OnGUI(){
if(enter == true){
GUILayout.BeginArea(Rect((Screen.width/2)-50, (Screen.height/2) , 100, 100));
GUILayout.Label("E to escape");
GUILayout.EndArea();
}
}