- Home /
How do i pause a scene off the start for 3 seconds
Im creating a tron game and I created a count down but when the gam starts the count down works but the game isnt paused so the bike moves while the countdown is running. So i want to pause the bike for 3 seconds or how ever long it takes for the countdown to go Iv tried this function Start () { pause (); } function pause (){ Time.timeScale = 0; yield WaitForSeconds (4.5); Time.timeScale = 1; } but that slows the wait for seconds to the point to where it doesnt move. how do i fix this which means the timescale never goes back to 1
have you tried making the speed of the bike 0 and after 3 seconds changing it to its normal speed?
simply use
Invoke()
for very simple timers in Unity, when you're starting out. go to unityGE$$anonymous$$S.com for many long examples
The tick at the bottom in the picture. Please don't post comments as Answers - hit the Add New Comment button 
Answer by 3dws · Mar 14, 2013 at 02:53 AM
i think u must use yield WaitForSeconds (4.5) in start function of your bike , try it.
Answer by Maulik2208 · Mar 14, 2013 at 08:57 AM
Ok as per my understanding at first you should Declare a bool.....by default make it false....then after finishing the timer make the bool to true......and then link your bikes to that bool means check for the status of the bool and according to that fix the behavior of your bikes...
if(bool)
{
// Do your bike related stuff here
}
if(!bool)
{
// Do the stuff which you want at the timer is running
}
According to me in first if condition you should have something like Gameobject.active = false; or maintain the speed to 0....and in second condition just make the object active or set the speed as per your needs..... Don't forget to mark the answer if you found it useful......
Your answer
Follow this Question
Related Questions
How do I start game paused 2 Answers
How To Make A Pause Menu? 1 Answer
Suspend script until keypress 2 Answers
Making a Pause Menu 1 Answer
Game freezes when i press play but when i press Esc it starts 0 Answers