this script below works to count down if the application.loadLevel(0); is not included, it would seem that the “if” statement is not skipping the loadlevel , when I include it, it reload straight away and the counter start at the set time again any ideas why ? .
#pragma strict
var timer : float = 60.0f;
function FixedUpdate()
{
timer -= Time.fixedDeltaTime;
if (timer <= 0)
{
timer = 0;
Application.LoadLevel(0);
}
and if you can’t load the level then check did you add the scene in build setting and can you see “0” in the right side ,if not save the scene then add it to the build setting
I want the game to count down from 120 sec and if the player cant complete the task in time the level restarts or even better they get the option to restart or quit .
It’s “a run against the clock” , in my script " timer" is a public float and I can reset the timer so i can work out how long it should take while Im doing it , before I build the level.
I would rather Java as I don’t understand the differences between C+ and java and all the other scripts are in java
I have the scene in the build window with the 0 as you describe.
I have a quit script if they do finish the task now but will need to work out how to stop the clock when they complete the task .