Issue with simple Coroutine to do w/ reloading level

I’m using a coroutine so that after a player dies, the level restarts after a short delay. The coroutine is written like this:

IEnumerator MyMethod()
		Debug.Log ("You're dead...");
		Destroy (PlayerSprite);

		yield return new WaitForSeconds(2.0f);
		Application.LoadLevel (Level 1);

So I want it to destroy the player, wait two seconds, and then reload the level (which is level 1 in this case)
Later, under a collision case for when the player collides with an enemy, I call the reference to the coroutine.


The things listed before the “yield return new WaitForSeconds” part activate perfectly, but what is supposed to happen after the two seconds never does. Anyone know the remedy? - Pie Lord

You should either load a Level id:

Application.LoadLevel (0);

or use its string name:

Application.LoadLevel ("Level 1");