Door script not loading the next scene?

Hello! I ask a LOT of questions here, but this one is confusing. :expressionless: This may also answer a different question too, but I made a script for a door using an OnTriggerEnter function and for some reason it refuses to work. Here is the script:
#pragma strict

var LevelNum : int;

function OnTriggerEnter (PlayerCol : Collider)
{
	if(PlayerCol.tag == "Player" && Input.GetKeyDown(KeyCode.E))
	{
		Application.LoadLevel(LevelNum);
	}
}

This should work, but if the player goes to the door and presses E, it does nothing. I know I am doing the OnTriggerEnter right because I have other doors set up to display a GUIText to say that it is blocked or locked. Please help. This is confusing and makes no sense that it doesn’t work. I may just restart the project to see if it is some problem with the assets or with the project itself. But, if there is just some simple error I missed then this will still be useful.

You probably want to be using OnTriggerStay instead of OnTriggerEnter. OnTriggerStay is called every frame while you’re inside the area. You should put some debug statements in your function to see where it’s breaking. Make sure you have “IsTrigger” set on your collider. OnTriggerStay &Enter are both intended for 3D colliders, you’d have to use OnTriggerStay2D for 2D colliders.