Good day I have a problem when the player finish stage 1 the screen look like this enter image description here

Then going back to selecting levelenter image description here

When I try to play the stage 1 again. I want to reset the stage 1 so i can play it again. I only use Scene.LoadScene("stage1") in main menu to go to stage1 and Scene.LoadScene("mainmenu") to back to main menu

enter image description here

  • \$\begingroup\$ Unity doesn't cache and reload runtime changes to the scene state when loading a scene a second time. So if it's loading in a different state, it's because one of your own scripts is saving information you want it to discard. To be able to help you fix that, we'd need to see that script. \$\endgroup\$ – DMGregory Dec 3 '19 at 12:31

Just reload your scene when level is complete.

  • \$\begingroup\$ How would they do that? (Please edit the post. ) \$\endgroup\$ – Vaillancourt Dec 3 '19 at 16:59
  • \$\begingroup\$ Write this line when you want to load current scene. "SceneManager.LoadScene(SceneManager.GetActiveScene().name);" \$\endgroup\$ – Muhammad Ehsan Dec 11 '19 at 13:31
  • \$\begingroup\$ Please edit the post. \$\endgroup\$ – Vaillancourt Dec 11 '19 at 13:42
  • \$\begingroup\$ can you explain me little bit more. i want to know did you save your data in GameManger.cs or in *.assets file. if you done this you need to make reset function of those value which you set on game start at the first time. and then you just need to call this function on OnEnable . Hope this will help you \$\endgroup\$ – Muhammad Ehsan Dec 11 '19 at 13:54
  • \$\begingroup\$ Comments are transient and can be removed at any time; also, users don't look for answer there, they read the post. Please edit the post. \$\endgroup\$ – Vaillancourt Dec 11 '19 at 16:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.