Next scene not loading

using UnityEngine;
using UnityEngine.SceneManagement;

public class levelComplite : MonoBehaviour
{
    public void LoadNextLevel()
    {
		SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
    }

}

I have got both scenes ticked on the build settings and I have an event that calls on this script but when I run this code it does not load the next the next scene it loads the same level can anybody help me.

Tested your script. It works fine. Just be sure to attach the script to a gameobject in the scene. Probably the way you call the script from another that is causing it. Would be appreciated if you provide the way you call the script.

I figured it out. It was not how I called the script that was the problem the problem was that after the player reached the end of the level as it is an auto move game then it went of the ground and fell causing a game over to be triggered so to fix it I added a block to stop it from falling of.

The function seems to be ok, but did you attach this script to some object in the scene? if yes then how are you calling this function can you show that?