Question by
Vincegame · Jan 12, 2020 at 08:40 AM ·
timescene-switchingrealtime
switching scenes after real time
Hey, i am working on an project were all the builds on a specific time must switch from scene. but i can't find a script to do this, can anyone help me? (sorry for the bad English)
Comment
Best Answer
Answer by GottesSchaf · Jan 12, 2020 at 02:15 PM
I don't know if I get your information correctly but I guess you want to switch your scene based on the Real World time?
If so here is another answered question which is hopefully answering yours too: Click
I need a script that switch from "Scene A" to "Scene B" at 12:00.
So you want to switch your scene based on real time? Or some set time?
Then just use that what I sent you earlier:
using System;
using UnityEngine.Scene$$anonymous$$anagement;
class YourClass {
DateTime now = DateTime.Now;
if(now == insert time here){
Scene$$anonymous$$anager.LoadScene("YourScene");
}
}
Hope that helps. :)