Hello so in my game I'm working on it is vital to have a reset button in the game so the scene restarts but when I try to get it working nothing happens. I have no errors pop up and my code is linked with the ui button so I'm not quite sure what the problem is here. the ui button is under canvas then the name of the button is Restart, in my script its named Restart and in unity it shows no compiler errors but when I push the button it flashes but nothing else happens. so if anyone knows how to fix this please help.
using UnityEngine;
using UnityEngine.SceneManagement;
using System.Collections;
public class Restart : MonoBehaviour {
public void RestartGame() {
SceneManager.LoadScene(SceneManager.GetActiveScene().name); // loads current scene
}
}