does anyone have a script so that when object “PlayerCar” collides with object “wall” there will be a room change to the menu
What do you mean ‘room change’? My scripting’s a bit rusty, but check for a collision like:
//Add this ot your car.
function OnCollisionEnter (hit : Collision) {
if (hit.gameObject.name == "Wall") {
//Do your action
}
}
Make sure the ‘wall’ object’s name is “Wall”. Should work ![]()
Do you mean room change as in you hit the wall and then it go’s to the menu scene?
If so you would do something like this:
function OnCollisionEnter (hit : Collision) {
//btw hit can be changed
if (hit.gameObject.name == "Wall") {
//change menu to the name of your menu scene
Application.LoadLevel(menu);
}
}