Hi!
I’ve been struggling with a following issue:
I want to have “Main Menu” button, clicking on which a Player goes back to main menu (different scene) and all his data on the current scene is destroyed. I have a bunch of Controller scripts, that are made in Singleton pattern, and I want them to be deleted with the LoadScene, but they just stay there and make annoying collisions with newly created ones (when Player starts new game).
Here is what happens, when Player clicks “Main Menu” button:
public void MainMenu()
{
Debug.Log("Loading Main Menu");
SceneManager.LoadScene("MainMenu", LoadSceneMode.Single);
}
Does anybody have any idea, what can be the cause of this problem? I’ve been sitting around it for quite a while and can’t figure out, what’s wrong ![]()
,Hi!
I’ve been struggling with a following issue:
I want to have “Main Menu” button, clicking on which a Player goes back to main menu (different scene) and all his data on the current scene is destroyed. I have a bunch of Controller scripts, that are made in Singleton pattern, and I want them to be deleted with the LoadScene, but they just stay there and make annoying collisions with newly created ones (when Player starts new game).
Here is what happens, when Player clicks “Main Menu” button:
public void MainMenu()
{
Debug.Log("Loading Main Menu");
SceneManager.LoadScene("MainMenu", LoadSceneMode.Single);
}
Does anybody have any idea, what can be the cause of this problem? I’ve been sitting around it for quite a while and can’t figure out, what’s wrong ![]()