Hi,
i am just developing a game with static and dynamic physics objects. I also use storyboard for scene transitions.
Now i implemented a reload button which simply reloads the Scene with storyboard.reloadScene(). In short the structure of my storyboard Scenes are as follows:
scene:createScene( event )
– i do nothing
scene:willEnterScene( event )
– physics.start()
– load Level (graphics incl. physics bodies)
scene:enterScene( event )
– add Event listeners
scene:exitScene( event )
– remove Event listeners
– remove graphics and physics objects.
– physics.stop() or physics.pause()
Everything would work great if physics.stop() would not crash the Simulator and also the app. It crashes randomly. sometimes after 3 refreshes sometimes after 30 refreshes.
So i replaced physics.stop with physics.pause(). Now the app and the Simulator does not Crash anymore. But the issue now is that my dynamic physics objects are a little bit displaced and the game is unplayable. Please see the attached pic. I have no idea anymore what i can do. Is there any fix in the Pipeline concerning the physics.stop() bug?
Thanks in advance for any ideas or help.
Thomas
Edit: i just found out that when i move my level creation code from the willEnterScene to the enterScene the displacement is gone. why?