Storyboard: Does "didExitScene" from one scene interfere with "willEnterScene" from the next?

I’m having some confusion with my Storyboard scene events. I was under the impression that variables local to one scene would not interfere with the next.

I’m getting some weirdness where my scene map created in one scene and then removed in “didExitScene” ends up deleting my map that’s created for the next scene in the “willEnterScene” event.

The maps do reference a common “constructor” function located in another file but that function returns a value to a local table in each scene and the “deletion” function references that local table.

The maps seem to work fine if I create the map in willEnterScene and then delete them in the exitScene event but that looks hacky with the slide transitions I’m using.

I would just create and destroy the maps in in the createScene and destroyScene events but then I get weird things with the static physics from the map “wall” objects lingering from one map to another.

I need physics “on” to create my map since the walls are static physics objects. Should I turn physics “off” on the exitScene event then to prevent this problem of “lingering physics”?

I’ve got all my systems largely functional. Storyboard is just killing me though. I’d *really* like to finish this game in the next two weeks… that would be huge. Like life trajectory changing.

Thanks for any help you can offer :slight_smile:

[import]uid: 105707 topic_id: 29530 reply_id: 329530[/import]

Hey!
Did you insert your display object to the storyboard display group? You should upload your code to hastebin.com or post it here, so everybody can have a look at it.
Regards [import]uid: 113596 topic_id: 29530 reply_id: 118556[/import]

@kristianarve

Yes, I did insert them into the display group.

Good point, I should share my code. I need to do some housekeeping on it first but I’ll get that up.

Thanks :slight_smile: [import]uid: 105707 topic_id: 29530 reply_id: 118558[/import]

Maybe this helps?

-- Called AFTER scene has finished moving offscreen:  
function scene:didExitScene( event )  
 local group = self.view  
  
 -----------------------------------------------------------------------------  
  
 -- This event requires build 2012.782 or later.  
  
 -----------------------------------------------------------------------------  
  
end  

(Taken from the docs) [import]uid: 113596 topic_id: 29530 reply_id: 118561[/import]

Hi there. I’m having trouble making the option clickable and changing the scene. I have a menu.lua file that has two options, and if a user clicks on one of them it will send him to a separate lua file. Are there any suggestions I could have? [import]uid: 162639 topic_id: 29530 reply_id: 119306[/import]