Make a button that when clicked opens the last level. And one for the next

I’m using a variable to unlock each level as they are completed. (when viewed from the level select screen)

I’m trying to create a “Replay” button and a “Next Level” button that shows up on the “You won!” screen after you complete a level.

If I use CurrentSceneName() for the “replay” button, it just reopens the “you won” scene. Which makes sense, so I guess what I need to know is what to type to access the previous scene for the “replay” button, and what to type to access the next scene for the “next level” button.

I am using the same “You Won” scene in between all levels, so I can’t just use “change to scene” and add the number since I would then need to create a separate “You won” scene for ever level.

I am assuming I can’t just use the variable that keeps track of the highest level accomplished because then it won’t work if a player has done 20 levels, but goes back to level 5. Because then if they hit “replay” it would replay level 20 because it will be marked as the highest.

Do you have a current playing level variable? Use that to replay the level.