put a timer on time.timeScale=0

I’ve got my game stopped using time.Timescale=0. So how then would I make that, be on a timer?
So like when the game starts and it says level 1, and it instances all the enemies, player ect, but I want it all to remain frozen for a few seconds be for the action begins or player control.
I understand delta time it out side of this? How could I write a simple yield, wait for seconds that will function when the games time scale is 0.
I understand I could do an object find and just deactivate the control script and animations ect. But there has to be a simple way to just temporarily pause then resume…?
thank you so much in advance!
I almost have my frame work nailed DOWN! Yeah!

You could consider: Unity - Scripting API: Time.unscaledDeltaTime
or : Unity - Scripting API: WaitForSecondsRealtime

might help you.

2 Likes

Thank you every much sir! I’m on it!

No problem. :slight_smile: Good luck.

2 Likes

Well shoot, my phone won’t seem to open that in the list, it just takes me in circles. I looked on my documentation but there’s no waitForSecondsRealTime to be found. Yield WaitForSecondsRealTime(); and it says unknown identifier. .hmmm

From the page I linked:

yield return new WaitForSecondsRealtime(5);

Is that what you wrote, and inside a coroutine?

2 Likes

Well I’m using Java actually. Thank you very much.

You know, I’m on unity 4.5. I don’t think waitForSecondsRealTime is on here yet? Maybe I should upgrade

I’m not sure. I would definitely upgrade from that. A switch to C# would be good, too. :slight_smile: