So , i’ve created a pause menu and a button in it to restart the level , but when i press it loads paused and in the point i’ve paused it . I want a code to restart the scene and not to load it from that point . Any ideas guys ?
If I understood well, you want add in the button a function that restarts thr scene-level. To do this create the following public void:
public void Restart()
{
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
}
But you should also write in the first lines of your script (a line under “using UnityEngine;”) :
using UnityEngine.SceneManagement;
and add your scene to the build settings to work