I am creating an Android 2d game in unity3d game engine. I've created an endless map and a continuously moving ball is my character. I've got some pits digged on my platform. If the user clicks anywhere on the screen, the ball will bounce. Now, if the ball accidently fell into the pits, I want the game to stop(meaning the game has failed) and restart from the beginning. Can anyone pls tell me the script or code I've to use for the game to restart ???? Any help would be great!!!!
You could fill the Pits with Box Collidiers wich are marked as Triggers.
Then you write a Script with
void OnTriggerEnter(Collider other){
if(other.gameobject.tag == "Player")
//do something
}
That should do the Job