I'm reloading the scene after a user clicks on retry. The Update function does not work after reloading the scene.
I searched the web and found DontDestroyOnLoad(), but I don't know how can I use it with a function.
Used
Scene scene = SceneManager.GetActiveScene();
SceneManager.LoadScene(scene.name);
to reload the scene.
Is this a bug from the unity side or i need to do something else before reloading the scene.
DontDestroyOnLoad()takes a game object parameter. That game object (and all its components) will not be destroyed whenLoadSceneis called, but if the new scene also contains that game object, you will end up with a duplicate. - Draco18s no longer trusts SE