- Home /
Question by
Kek_Kek · Jun 24, 2017 at 11:58 AM ·
scripting problem
How do I change scenes from my credits to my main menu using a trigger.
I made my credits scroll up but I don't know how to to make it wait a few seconds before changing to my main menu.
Comment
Best Answer
Answer by Pigenator · Jun 24, 2017 at 01:21 PM
public float secondsToWait;
bool creditsEnded;
if(creditsEnded){
StartCoroutine("ReturnToMenu");
}
IEnumerator ReturnToMenu(){
yield return new WaitForSeconds(secondsToWait);
LoadMainMenu();
}
When the credits are finished start wait for (secondsToWait) seconds then call the function "LoadMainMenu". That's how i would do it.