Might be a potential bug

So i followed Gdevelop rpg example of the scene change about battle
and instead of going back after the fight, the scene just resets


2 Likes

Well for one, I’ve seen some of your posts, please don’t be so vague (not descriptive) with your titles, just saying “Problem Here” isn’t enough to attract attention.
Now I don’t know much about scenes so I won’t insert myself too much, but there’s probably something wrong with your events. X^X
I might be wrong though, maybe it is a bug.
(Probably not.)

How are you switching to this scene. Make sure it’s not going back to the previous scene and then immediately back to this scene. It can happen if both scenes use the same type of trigger or the condition that changes to the current scene are are still true when it returns to the previous scene.

I’ve seen issues where buttons are in the same place or a variable was used to change scenes and it was true before the scene change. If it’s still true then it will trigger the scene change again. The same can happen if the same key is used in each scene. The is pressed event could be triggered in each scene.

Also a reminder that change scene events almost always have to be accompanied by a Trigger Once condition.

when i added trigger once to the first fight side. it just showed a black screen after the fight

I’m quoting Keith here

U should test what he said

imo thaz the problem.
You have the var “victory” true at the next step with the same “Z” button for attack and reset scene.
I would check the victory var reset to false first.

Edit: ALso Silver is right add trigger once to the swap scene event

I changed the keys but i am still confused

and also changing keys did not work

You can use the debugger to see what’s happening. Add a message to the debugger with a condition of at the beginning and resumed to see if the scene is changing or it’s stuck in a loop.

You can add this to both scenes.

You can do the same for variables. If a variable triggers something then either use trigger or change the variable when the event gets triggered. IDK what happens with trigger once when a scene is changed. I’m guessing they get reset. Make sure the variable or condition is also going to return false.

If there’s a black screen then it’s either not loading or it’s stuck in a loop. Are you using any while events?

after changing buttons it is now just a black screen

where do you find the debugger

https://wiki.gdevelop.io/gdevelop5/interface/debugger/