- Home /
How to make a time mission
For instance, they have five minutes minutes to finish the mission. How can i make a timer and after the five minutes have passed, send the user to another scene because they lost?
Answer by xt-xylophone · Jun 14, 2013 at 05:20 AM
If its just a timer you need, yeah its quite simple.
When the scene starts I assume you have some functionality to handle the 'logic' of the Level. Just save the current time to a variable using: Time.time For reference: http://docs.unity3d.com/Documentation/ScriptReference/Time-time.html
Then on it's update you could check if the current time(using Time.time again) minus the start time is >300(5*60sec) then do your logic of 'failing the level' there
Hope that helps!
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
How to open a door after a numerical password? 1 Answer
unity3d ios 1 Answer
Set Screen Size To Only Be Wide? 1 Answer