#pragma strict
var enter : boolean = false;
function Update (){
if(Input.GetKeyDown("e") && enter)
{
Application.LoadLevel("room 1");
}
}
function OnGUI(){
if (enter){
GUI.Label(new Rect(Screen.width/2 - 75, Screen.height - 100,150,30), "Press E to enter");
}
}
function OnTriggerEnter (other : Collider) {
if (other.gameObject.tag == "Player") {
enter = true;
}
}
function OnTriggerExit (other : Collider) {
if (other.gameObject.tag == "Player") {
enter = false;
}
}
When i walk into the cube i have that is suppose to be the trigger and i press “e” it doesnt load to the next level. i have trigger selected on the box collider and i have the build settings right. i tried rigid bodies too. is it because i have a lantern layered on a different camera? so the lantern doesnt appear as though its going through walls? i need help badly.