Add a Delay at the start of a level
Im trying to find a way to add a timed delay at the start of an infinite runner, i cant find a tutorial covering this. Im looking to delay the infinite running script buy about 30seconds so i can add a basic tutorial at the start of the level.
Answer by tormentoarmagedoom · May 08, 2018 at 02:36 PM
Good day.
You need to make a timer, something like this.
float TotalTime, CurrentTime();
bool LevelStarted;
void Start()
{
CurrentTime=0;
TotalTime = 30;
}
void Update()
{
if (!LevelStarted)
{
CurrentTime += Time.deltaTime;
if (CurrentTime >= TotalTime)
{
Do what you want
LevelStarted = true;
}
}
}
Buut! If you want to make a tutorial, maybe you should create new scene.... :D Bye!
Thanks @tormentoarmagedoom thats a big help, how do i apply it to the level just an empty gameObject?
Your answer
Follow this Question
Related Questions
How to get left time from countdown to point? 0 Answers
How do I stop my timer script from crashing unity? 0 Answers
Text UI shakes when being updated with a countdown function 1 Answer
Where and how should I stop the counter when the while loop is ended ? 0 Answers
How to make a depleting bar timer GUI please help! 0 Answers