Playerprefs.SetInt Problem

when scene change then update level text but problem was there every time 2 increase when scene change not 1 increase

Code:

 public string currentscenename;                  //Store Level 1

 public string nextscenename;                    //store Level2
 
void Start()
{
        leveltext.text = "LEVEL " + PlayerPrefs.GetInt("Level", 0).ToString();
 }

void FixedUpdate()
{
    leveltext.text = "LEVEL " + PlayerPrefs.GetInt("Level", 0).ToString();
    //some code here
}

 public void Next()
 {
    int num = PlayerPrefs.GetInt("Level", 0);
    num++;
    PlayerPrefs.SetInt ("Level",num)               //problem here every time increase 2 not 1 add
    if (currentscenename == nextscenename)   
    {
            Next();
    }
    else
    {
            SceneManager.LoadScene(nextscenename);
    }
  }

Hello.

First, where Next() is called for 1st time?

Second, You need to debug your code while runnig man… Then will see why “its icreasing 2”…

OR you are running it twice, or you are increasing the value in any other place…

You must learn to debug your problem…