[Solved] How do i detect if scene does not exits

i have this piece of code:

how do i check if that scene does not exits?

IDK if you can check if a scene exists.( Maybe with JavaScript) A better technique would be to use a global variable like MaxScenes=10

If something happens currentScene + 1

If CurrentScene <= MaxScenes goto that scene

If CurrentScene > MaxScenes goto whatever scene you want like a level select screen or menu.

Without using Javascript, consider adding a subevent to the event with the change scene action. If it reaches the subevent, then the scene wasn’t opened and doesn’t exist.

1 Like

Hi I’m adding a new condition for it.
It will be ready in 5.1.162 :wink:


1 Like

I see the new does scene exist condition. I don’t know why it defaults to a drop-down list of existing scenes. Wouldn’t the scenes always exist if it’s in the drop-down list? It took me a second to notice the expression button. It seems like all it needs is a string expression box so you can add text and/or string variable.

1 Like

It was quick. But yes, not sure we can force it right now, maybe in another quality of life update asap :slight_smile:

1 Like