[Solved] How To Game Over

Sorry guy I’m a stupid rabbit but Game Over works fine… if only 1 level change scene to Level 1-1 but now with Level 1-2 i Game Over and back to Level 1-1 which is fine but I’m curious is there a way to make where it restarts you ON the scene you died on no matter what level… in case

You can use CurrentSceneName() as the scene name parameter when you change scenes. This will restart the scene that’s currently running.

1 Like

Thank you but sadly while i know the action you speak… i have no idea how to use it correctly

Find change scene in the list of actions, then click on the “Use an expression” button and enter the expression:

image

Ok a bit more information When the player dies it goes to a new Scene called Game Over which a player can click try again or give up now while it worked so long i had 1 scene to play on now when they click the button it goes only to 1-1 no matter what… ( I did the currentscenename() ) its not a dead stay on screen and restart it goes to a different scene that scene you must click a button to retry the level you failed on… forgive me for not giving info was late Your answer would be right if i asked correctly

I’d just like to mention that punctuation would make your post a lot easier to read and comprehend (to figure out where to put the full stops or commas, read the sentence aloud and when you stop to take a breath, that’s where a punctuation mark is needed) :smiley: .

Back to your issue though - there are a number of solutions. The easiest is to store the current scene name in a global variable and then change scene to the Game Over scene.

From the game over scene, when the player chooses to retry the level merely change scene using the global variable.

1 Like

sigh can you show me an example? I’m afraid its hard for me to grasp this for some reason

Sure. First create the global text variable. I’ve named mine g_LastSceneName.

In the level scene, use the following actions:


In GameOver events, when the player selects retry, use:

image

1 Like

VICTORY IS OURS TODAY for the stupid has prevailed with trial and error… and rereading his code 792346893475634865 times Thanks!

2 Likes