Here is my pause
method:
- (void)togglePaused
{
self.paused = !self.paused;
self.physicsWorld.speed = !self.paused;
}
...where self
is the SKScene
.
The reason I include the second line is that I noticed that when unpausing, all my physics-enabled nodes were jumping forward immediately, as if the physics has continued running in the background though the scene was paused.
Unfortunately, that does not solve the problem.
How can you pause an SKScene and the SKPhysicsWorld such that, when unpaused, the physics simulation begins where it left off?