#pragma strict
function OnCollisionEnter(collision: Collision) {
if (collision.gameObject.tag == “Exit”){
Application.LoadLevel (“Level_2”);
}
}
the idea of this code is to have my player hit the cube(which is tagged “Exit”), and then the game will switch to another level called Level_2
The problem is the collision just doesn’t work. My script is attached to my player which is the standard first person controller.