Hi,
Probably a basic Newbie question and apologies if its been answered elsewhere, i’ve looked but can’t seem to find a definitive answer…
But basically what is the correct way to setup and use physics when using the storyboard API?
In a storyboard scene i’ve declared the ‘local physics = require(physics)’ at the top of my code and outside any storyboard function making it local to that storyboard scene but where should I call ‘Physics.Start()’ and setup my physic bodies? and what is the correct way to pause, remove any physics bodies when leaving and returning to scenes?
One bit of documentation mentions I should put ‘physics.start()’ within the ‘scene:enterScene’ function but if i create my physic bodies from within the ‘scene:createScene’ they fail to run and I get a ‘Corona Simulator ERROR: physics.start() has not been called.’ message in the terminal output. Am i right in thinking i have to start and then pause the physics API at the start of the ‘scene:createScene’ function and then restart the Physics once the ‘scene:enterScene’ function is called?
Also when creating Physic bodies, do they have to be assigned to the storyBoard ScreenGroup? I’m guessing they do and If so what happens on purging, removing and re-entering Scenes and the Physics API, where should I be pausing or stopping the physics? Will bodies be deleted from the physics API once a scene is left and if so do i need to recreate them. I’m guessing I should approach them in the same way as when i’m working with display objects and groups from within the storyBoard API?
Any help or pointers would be greatly appreciated!!