I am trying to make the scene change when the character collides with an object like a door, but it won’t work and their are no compiler errors. Here is the script:
function OnCollisionEnter( collision : Collision ){
if (collision.gameObject.tag == “Player”){
Application.LoadLevel (“s2”);
}
}
Edit
Here is a working script I found:
function OnTriggerEnter (other : Collider) {
//Check to see if a player entered the door.//
if (other.gameObject.CompareTag(“Player”) && Input.GetKey(KeyCode.E)) {
Application.LoadLevel("scenename");
}
}