I have to make a retry function.I make a value in main menu to save which scene the player is playing. But i have no idea how to get the value in the main menu and use this value to detect which scene is the player lose.
you can try playerprefs link text or u can create a static var int and store the current level number(when the player lose) in it and then check it in the main menu .