I have an SKSpriteNode with a dynamic physical body on SKNode *_fgLayer .
Now, when I pause or pause the game, I want SKSpriteNode to stay in place and not spin or fall. If I just use _fgLayer.paused = YES; , SKSpriteNode does not remain in place, but rotates and falls. If I set physicsBody.dynamic = NO; when paused and physicsBody.dynamic = YES; When it has been suspended, it will work.
However, after several attempts, I always get the following failure:
"Assertion failed: (typeA == b2_dynamicBody || typeB == b2_dynamicBody), function SolveTOI, file /SourceCache/PhysicsKit/PhysicsKit-4.6/PhysicsKit/Box2D/Dynamics/b2World.cpp, line 670."
So, I suppose setting physicsBody.dynamic = NO; and back does not work.
Does anyone have an idea how to pause dynamic physical bodies in order to stay in place when the game is paused?
source share