Load Previous Scene Script (challenge)

So we have a game of 15 Levels, if you fail any of these levels it takes you to a fail menu (this fail menu is for all 15 levels) what we are trying to achieve is that on a button click to reload the previous level we were on, so to avoid the need for creating 15 separate fail scenes.

for example if you fail level 5 and it takes you to that scene, we want to be able to go backwards to scene 5.

ANY help would be greatly appreciated… i prefer not to fail my software course…

Thankyou!!

DUPLICATE QUESTION : http://answers.unity3d.com/questions/1415799/how-to-load-a-previous-scene-after-a-restart-scene.html?childToView=1415852#answer-1415852

What have you tried so far?

When it “takes you to a fail menu” what is your script? You will be able to pass the current level as a parameter at some point. If this is a simple game, you could even store the current level in a game controller.

You can also create a scene loaded callback to pass the value into the loaded fail menu scene.