Hi all.
I have currently two scenes in my game. When the player dies in scene-1 it loads the 2nd scene, which has a button to click to go back to scene-1. I’ve added all the scenes to Build Settings, assigned the loading function to the button – but the button won’t load the scene-1. However, when I use Enter key to load scene-1, it works fine. I can’t figure out why the button won’t work.
Code for the Button (Not working):
public void LoadScene(int sceneN)
{
SceneManager.LoadScene(sceneN);
}
Code for the “Enter” key (Works):
private void Update()
{
if(Input.GetKeyDown(KeyCode.Return))
{
SceneManager.LoadScene(0);
}
}
Click event for the button:

Build Settings:
Here’s what it looks like when playing:
Thanks for any help!
