You need to write it like this:
function OnCollisionEnter(col : Collision) {
if (col.collider.name == "Player" ) {
Application.LoadLevel(1);
}
}
or if you want to use it with TAG:
function OnCollisionEnter(col : Collision) {
if (col.collider.tag == "Player" ) {
Application.LoadLevel(1);
}
}
↧