Simple script

Hi guys
I need a simple script so that when an object call ‘car1’ collides with an object called ‘wall’ the scene will change to the menu

thanks

function OnControllerColliderHit(hit : ControllerColliderHit){

if(hit.gameObject.tag == “Wall”)
{
Application.LoadLevel(0);
}

}

something like that and create a tag called wall for all your tags.

You will also need to set up in the buildsetting the levels. I am assuming your menu would be 0.

You can use that to figure it out:

void OnControllerColliderHit(ControllerColliderHit hit) {

if(hit.collider.name=="wall") Application.LoadLevel("menu")

}

You should have “menu” scene (or 0) and replace OnControllerHit with proper Monobehaviour

THey don’t work :frowning:

well you need to be more detailled?

Is the script attached to your character controller?