- Home /
Checking the scene/Level you are?
Hello Unity Answers.
A simple question:
How can I check in code the scene I am? I have a timer that is supposed to start when the scene start (This scene is the 4th level) And the timer start on the first level.
just something like:
if(Scene == Level1){
start timer //I know this is wrong, so dont tell me that.
}
Comment
Best Answer
Answer by Bauerranger · Jul 27, 2018 at 09:06 AM
Application.loadedLevelName is obsolete. You need to use...
if (someString == SceneManager.GetActiveScene().name)
{
//do stuff
}
...now.