Yield refuses to work. Js

Can someone help me, yield won’t work for me, this is the second project it won’t work in, and I’ve tried reinstalling too as well as installing previous versions of Unity cause I do not see what I’m doing wrong.

function Lose()
{
print(“before yield”);
yield (WaitForSeconds(2));
print(“after yield”);
Time.timeScale = 0;
guiMode = “Lose”;
}

“before yield” prints out, but “after yield” never shows up and neither does anything after it.
However if I remove the yield line all together everything works except the explosion doesn’t get to show that way…

I tried all variations of yield I can think off and none work.

I tried like the one in the tutorial video (Mine Lander UnityCookie) and:

yield WaitForSeconds(2);

and

yield (WaitForSeconds(2.0));

and

yield WaitForSeconds(2.0);

but none work, only “before yield" prints out and no menu pops up and time doesnt freeze.
And like I mentioned, it didn’t work in another project either.

Any ideas, or alternative ways of waiting a couple sec?

Ok solved it.

Since I had another object calling the function Lose, which I didn’t mention cause I didn’t think it was important, and the object calling it got destroyed after calling it, the Lose function stopped executing all together. I thought I just have to call it before destroying the object and it would work fine, like it does in the tut, but it doesn’t. xD

Anyway in case someone needs it, I solved it by adding another function, LoseCaller onto the GUI Object that doesn’t get destroyed, as a relay even tho that one never gets destroyed in any case. Guess it kind of makes sense now why it wouldn’t work… Oh well. xD

Ship Object:

var GUI : InGameGUI;

function Start ()
{
	GUI = GameObject.FindWithTag("GUI").GetComponent(InGameGUI);
}

function Explode()
{
	var randomNumber : int;
	randomNumber = Random.Range(0,shipExplossions.length);
	Instantiate(shipExplossions[randomNumber], transform.position,transform.rotation);
	GUI.LoseCaller();
	Destroy(gameObject);
}

GUI Object:

function Lose()
{	

	print("before yield");
	yield (WaitForSeconds(2));
	print("after yield");
	Time.timeScale = 0;
	guiMode = "Lose";
}

function LoseCaller()
{
	Lose();
}

Change timeScale to 1.0 before doing the yield.