variable dealing with levels and bettween scences

hello … iam begginer in using unity . when i use my frist project in it i have a problem
as the counter didn’t change as in every level it inisialize as i use the same script …i use static one

public static int level=1;
so how i can initialize the static variable only one time in the frist level (i use the same script each level) or i want to make it more global and put it out of this class but where and how ?

Hey there! Take a look here:

Maybe you can do something like…

public static int level;

void Start()
{
level = Application.loadedlevel;
}

This here will display the level index. Just remember that the level index starts at 0, i’ve been confused by that sometimes. I’m glad if this helped and good luck with your project :slight_smile: