- Home /
How to see what level is running?
Hello,
I have a gameobject that exists on many levels. I want to do an action of it when it's on a certain level.
How I check this?
I tried this but t doesn't work
if(Application.loadedLevel == 2)
{
}
Comment
Answer by gregzo · Jul 27, 2013 at 11:44 AM
Application.loadedLevel returns the index of the last loaded scene. Check your build settings to see if the indexes match, or use Application.loadedLevelName instead, which returns a string.
Your answer
Follow this Question
Related Questions
Loading Scene on a series of events 2 Answers
Load Scene 1 Answer
Random level select 1 Answer
Input.GetMouseButton on multiple objects 1 Answer
Load level after Image Sequence 0 Answers