Time.timeScale problem

So, i creating a popup GUI that will show a countdown timer, but i need to make the scene behind the popup GUI standstill…
i’ve been searching awhile but i don’t get anything that could satisfied my need…
here’s my code for the process…

function OnGUI() {
	if(GUI.Button(new Rect(30,350,80,80)," ",tombol1)){
		popUp = true;
			player_hp = 0;
	else if(GUI.Button(new Rect(90,280,80,80)," ",tombol2)){
	else if(GUI.Button(new Rect(130,350,80,80)," ",tombol3)){
			Time.timeScale = 1;
			GUI.BeginGroup(new Rect(208,97,350,350),soal);
			GUI.Label (new Rect(100,20,50,50),seconds.ToString());
function Countdown(){
	if (--seconds == 0) CancelInvoke ("Countdown");
	seconds = parseInt(seconds.ToString());

so i tried it and when i encounter the GUI, the counter does counting down, but in hyperspeed, i am not sure what happening there…
but if i set the Time.timeScale to 0, the countdown timer just not counting… it really confuse me, what should or could i do to fix this kind of problem?

I see two problems:

First, it looks like you might be calling InvokeRepeating once per frame while the popup is active. That’s going to cause quite a few calls to Countdown, and that’s why your timer was moving too fast. Your script assumes that each call means one second has passed; that’s only true if you call it once per second.

Second, setting Time.timeScale to zero will freeze time completely. It’s easy to overlook some of the implications. Among other things, coroutines and invokes that rely on conventional time passing will stop, and that’s why your timer was stopping. Animations and audio that are tied to time will also stop. There are some popular workarounds which are mentioned in this thread: Freeze game using Time.timeScale = 0. Most involve some clever use of Time.realtimeSinceStartup, which is not affected by timeScale.

From the workarounds thread, you might want to try the very small timescale, or pause the game completely and switch to coroutines.