'reset' game on collision?

hi

is there any way to reset the game if the player collides with a given object?

thanks

Yes, you can use Collider.OncollisionEnter and call your reset function or simply use Application.LoadLevel(Application.loadedLevel) if you want to reload the same level.

in a collision event like OnTriggerEnter or OnCollisionEnter, load the first level or the current level or just reposition main character to it's initial position. it's based on the kind of reset that you want. the event of collision is available easily. just create a gameobject and add a collider to it and check it's is trigger property on inspector. the write something like this.

function OnTriggerEnter (other : Collider)
{
//check if it's the player that is colliding with this reset object by name/tag or anything else you want
if (other.name == "main player")
{
//do your reset here
Application.LoadLevel(Application.loadedLevel); //reset this level.
}
}