My next scene is not loading ,

I’m trying to load the next scene once a certain amount of points is collected … the next scene is loaded as a dead scene with no functions and on the hierarchy (the scene is loading ) and (the scene not loaded) are blinking , this is my code :

private void Start()
{
    Scene scene = SceneManager.GetActiveScene();
    Debug.Log("Active Scene is '" + scene.name + "'.");
    nextSceneToLoad = SceneManager.GetActiveScene().buildIndex + 1;
    highScore = PlayerPrefs.GetInt(PlayerPrefManager.HIGH_SCORE);
    PlayerPrefs.SetInt(PlayerPrefManager.SCORE, 0);
}
private void Awake()
{
    {
        SetUpSingleton();
    }
}
private void SetUpSingleton()
{
    int numberGameSessions = FindObjectsOfType<GameSession>().Length;
    if (numberGameSessions > 1)
    {
        Destroy(gameObject);
    }
    else
    {
        DontDestroyOnLoad(gameObject);
    }
}
private void Update()
{
    if (score > highScore)
    {
        highScore = score;

        PlayerPrefs.SetInt(PlayerPrefManager.HIGH_SCORE, highScore);
    }
     if(score==levelScore)
     {
         LoadNextScene();
    }
    PlayerPrefs.SetInt(PlayerPrefManager.SCORE, score)
}
public int GetScore()
{
    return score;
}
public void AddPoints(int amount)
{ 
    score += amount;      
}   
public void LoadNextScene()
{
    SceneManager.LoadScene(nextSceneToLoad);
}

}

This script is surviving into the next scene, since it is set to DontDestroyOnLoad, so on the next update cycle after loading the scene, the conditions to load the next scene are still true, so it loads again, and again, and again, etc…

To stop this, in LoadNextScene, before you call LoadScene, update levelScore to whatever the next level requires, THEN LoadScene, and you should be good.

Hope this helps,
-Larry