Problems with level transitions

I have a bunch of levels I want to link up to but my scripts don’t seem to work. All the levels are in the Build Settings and this is what my script looks like:

var Level2 : String;

function OnTriggerEnter(hit :
Collider) {
Application.LoadLevel(Level2);

I’m not sure if this needs to be C# or Javascript though. I have a box collider that the player walks into at the end of the level but it doesn’t seem to be registering. The box is marked as a trigger.

What would be a good Javascript script for transitioning between levels?

Looks good to me. Do you get any error messages? Are you sure the trigger works?

Put in a Debug.Log() into your OnTriggerHit()-method to check if it gets entered.