I am trying to make a count down timer from 3 to 0 by seconds. The timer will be displayed on screen. Problem is, I cant find a way to call the timer to run threw a function only once. Instead it calls every single frame.
Here is a list of things I have already tried but failed: InvokeRepeating <- cant seem to get a Time.deltaTime to run when it is called every frame Store variable - variable-- <- Obviously didnt work, but you got to try everything before posting right? Functions <- Didnt work as the function can not be called only once, instead it is called every single frame And much much much more (over 5 hours of trying to get it to work)
Other Info: I am doing this when you dont have enough money it states you don''t have enough and shows the time until automatic cancel.
I feel soooo dumb as this sounds stupid easy, but all in all. I cant find out how to make it run with Time.deltaTime or just run once in a function.
The question has been closed Oct 23 '13 at 01:15 AM by meat5000 for the following reason:
The question is self answered
I fixed it before a moderator even approved the question.
CountDown Here: http://forum.unity3d.com/threads/117533-Timer-Help
what is it for?
you could create a separate variable called cooldown, give it a time of 3 seconds create a function to store your timer have it start at your cooldown variable and when it reaches 0 it goes into your if statement
( all in all, try and implement it outside of the update loop, maybe on start or awake? depending on what you are doing because without knowing what setting its in or seeing the code its kind of hard to give a straight answer :D)