Timer Countdown Pop Up Screen Before Scene "Starts" Please Help!!
Hey everyone I was wondering if anyone could help me or point me in the right direction. I am looking to make a pop up UI that incorporates a 3 second timer countdown. Then after it is done counting, it disappears and the level is there to interact. I kind of have some experience with the UI pop up screens. I am mainly trying to figure out the countdown timer on that pop up UI. While the timer is counting down, I want the scene behind it to be "frozen or not moving" The pictures show an example of what I am looking for:
If anyone could help me out or point me in the right direction I would GREATLY appreciate it! Thank you.
Answer by Redwolve · Apr 12, 2016 at 03:59 AM
So make it so that nothing in the scene will move until the countdown is done by using a boolean that is false until you are done with the countdown. then complete your countdown, i assume you have that part down for now? if not i can assist with that as well. but surrounding the game code with a while(countedDown) should help you get the job done.
let me know if it helps !
Answer by Jalah_LLC · Apr 12, 2016 at 07:30 PM
@Redwolve I do appreciate the input!
So make it so that nothing in the scene will move until the countdown is done by using a boolean that is false until you are done with the countdown. then complete your countdown, i assume you have that part down for now?
I actually do not have that part down lol. If you could help me with the code for that, or point me in the right direction I would GREATLY Appreciate it! Thanks.
So the way i see this working is you make a UI Canvas for your countdown images. Have it be the full screen and set a script on it to change from your sprites for 3 to 2 to 1 and then disable it and at the same time setting you countedDown bool to true and that would trigger you game to start moving. $$anonymous$$ake sense?
@Redwolve I think so. Only problem is I am not sure is the actual scripts used to accomplish this. Do you think you could help me out with all the code needed or point me in the right direction? Thank you I really do appreciate it!
well i cant give you all the stuff at the moment, could give you the basics
create a new ui image, it will create a canvas and i think a panel as well, if you dont already have one. set the canvas scaler to scale with screen size. then run a script on it that:
has a timer to countdown the seconds countdown = 3;
countdown-=Time.deltaTime;
assigns the image to the respective spritefor when the values change
the image assignment would be the tricky part if you are versed in it yet.
should work something like this:
var image1:Image; var image2:Image; var image3:Image;
gameObject.GetComponent.().image=image1;
i havent done the source image change yet myself so the actually code for it may be different but some delving through the API will get you there from here.
Let me know if you get it