[Solved] Gdevelop crashes when I switch to another scene in the game

When I click on the Preview of the game, everything works well at first, but then when I replay the same level without leaving the preview and when I switch to the next level, the preview crashes, but there are no errors in the Debugger.

When I posted a link to the game, almost the same thing happens when playing in the browser: the browser does not crash, just nothing happens, the scene does not switch. I found a way out like this: I added an action so that after a while the scene would switch again.

It helped, but I’d like to know what’s wrong?

Solution: it turned out that the button for the death menu (with which you can close the game) and the button for the finish menu (with which you can go to the next level) were in the same position. And I forgot to disable the exit button if the death menu is hidden.

Why are you changing scene after you’ve changed it? In theory, once you change the scene any actions afterwards won’t get actioned.

Remove the sub event.

It helped when I exported the game in the browser. When I click on the next level button, and if nothing happens in the browser, and at that moment an additional level switching action is triggered. This is my solution to the problem that I described above. But Gdevelop, when it can’t switch to the next level, just crashes.

Gdevelop sometimes switches to the next scene, sometimes not.

Next time it doesn’t switch, check the console output in the developer tools.

Also, you haven’t given context to the screen snip. Are there any parent events, or is it a top level event?

The console does not issue errors. There is only one parent event - that the device does not have a touchscreen.

The most interesting thing is that the LevelsButton always works without failure.

Is there a button on the second screen that is in the same place as, or overlaps, the “NextLevel” button on the first screen?

Yes, it turned out that the button for the death menu (with which you can close the game) and the button for the finish menu (with which you can go to the next level) were in the same position. And I forgot to disable the exit button if the death menu is hidden. Thank you!)