Change from a scene to a previous scene

Hi, all.
I’ve created a new project as “Physics Based Game”. The button in the first scene (named “menu”) sends for the scene “level1” using the “storyboard” function. In the scene “level1” I’ve just created a function that is supposed to send me back to the scene “menu”, but it just stops the game.

Can someone help me?
Thanks from now. :smiley: [import]uid: 162818 topic_id: 29936 reply_id: 329936[/import]

make sure in “menu.lua” that you -storyboard.removeScene(‘level1’)
[import]uid: 75779 topic_id: 29936 reply_id: 120059[/import]

If I remove my scene “level1” on the “menu” I can’t access the “level1” anymore.

local function toMenu( e ) if(e.phase == "began")then storyboard.removeScene("level1") end if(e.phase == "ended")then --os.exit(); storyboard.gotoScene("menu", "fade", 500) --return true end end close:addEventListener("touch", toMenu);
(“close” is the button object)
That is what I added to my “level1”.

Do you see something wrong here? [import]uid: 162818 topic_id: 29936 reply_id: 120065[/import]

Their are 2 files, menu.lua and level1.lua. You are showing level1.lua. put the storyboard.removeScene(“level1”) in the menu.lua file. You have it in level1.lua file so it is removing itself mid-code thus the error. [import]uid: 75779 topic_id: 29936 reply_id: 120071[/import]

make sure in “menu.lua” that you -storyboard.removeScene(‘level1’)
[import]uid: 75779 topic_id: 29936 reply_id: 120059[/import]

If I remove my scene “level1” on the “menu” I can’t access the “level1” anymore.

local function toMenu( e ) if(e.phase == "began")then storyboard.removeScene("level1") end if(e.phase == "ended")then --os.exit(); storyboard.gotoScene("menu", "fade", 500) --return true end end close:addEventListener("touch", toMenu);
(“close” is the button object)
That is what I added to my “level1”.

Do you see something wrong here? [import]uid: 162818 topic_id: 29936 reply_id: 120065[/import]

Their are 2 files, menu.lua and level1.lua. You are showing level1.lua. put the storyboard.removeScene(“level1”) in the menu.lua file. You have it in level1.lua file so it is removing itself mid-code thus the error. [import]uid: 75779 topic_id: 29936 reply_id: 120071[/import]