How to "Restart level after 2 seconds "

Hi, i’m trying to make the main scene of my game restart after my character dies.
But my script just won’t work.

It is attached to the trigger on my character head, and is in the same script that makes my character die.

What should i do to make it work?
Here it is:

var explosion: Transform;

function Start () {

function Update () {


function OnTriggerEnter (otherObject: Collider)

  if(otherObject.gameObject.tag == "FallingObject" )

    Destroy(GameObject.Find("First Person Controller"));
    var tempExplosion: Transform;
  tempExplosion = Instantiate(explosion,transform.position,transform.rotation);

  yield WaitForSeconds(2.0);



If I understand your design, this script is a component of the character (maybe one of the character’s children ?). In this case you can destroy the character in this script with Destroy(gameobject);

But this will also destroy your script, and prevent re-loading.
You could use an empty GameObject (let’s call him “GameFlow”) that won’t be related to your character (probably at the base level of your hierarchy), and add a script to this “GameFlow”.

The script you posted should have a reference to “GameFlow’s” script, so that it can do this : gameFlowScript.Invoke(restartLevel,2f);