Loaded LevelName

Hi All,

How do I check for the last level(Scene name) that was loaded?

This is what I’m trying to do, no errors it just don’t do anything.(No worky)!

function OnMouseDown()
{
   if(Application.loadedLevelName == "NameOfTheLevelThatWasLoaded")
        {
            DoSomething;
        }
}

I know this was discuss here before but can’t find the thread/topic.

Thanks,
Ray

Got it

if(Apllication.loadedLevelName == "shouldbesmallcaseletters")

print(Application.loadedLevelName) helps! :smile: