Alternative for Application.LoadLevel(Application (loadedLevel)

So I’m revisiting the old 2D Roguelike tutorial from Unity. I’m trying to find an alternative now that Application.LoadLevel is obsolete. Because so far everything I’ve done with SceneManager does not yield (lol) the same results where it’s basically restarting the same exact scene. SceneManager.LoadScene(0);
Using that just completely destroys everything and my board won’t rebuild despite the fact it’s set to do so on Start… I put 0 in the LoadScene brackets because that’s literally the only scene I have in the build settings.

The closest alternative I can think of is this…

SceneManager.LoadScene(SceneManager.GetActiveScene().name);

Hope this helps,
-Larry

I’m trying to achieve what he’s doing around the 8:36 mark in the video.

My code is as follows trying to replicate it with SceneManger.

  private void Restart()
    {
       SceneManager.LoadScene(SceneManager.GetActiveScene().name);
    }

    public void LoseSouls(int loss)
    {
        animator.SetTrigger("Hit");
        souls -= loss;
        CheckGameOver();
    }

    private void OnTriggerEnter2D(Collider2D other)
    {
        if(other.tag == "Exit")
        {
            Invoke("Restart", restartLevelDelay);
            enabled = false;
        }

        if(other.tag == "GreenSoul")
        {
            souls += greenSoul;
            other.gameObject.SetActive(false);
        }

        if(other.tag == "BlueSoul")
        {
            souls += blueSoul;
            other.gameObject.SetActive(false);
        }
    }

So That’s what happens when I reach the Exit point in my scene. It doesn’t regenerate the board.