I want to remove the physics sprite and the shape and the body when the physics sprite was collided.
The physics sprite was created with “createPhysicsSprite”,was able to be removed with “cc.Node.removeChild” .
But how to remove the body and the shape?
I tried to remove them with Space.removeShape and Space.removeBody ,got the following errors.
Uncaught Error: Assertion failed: This addition/removal cannot be done safely during a call to cpSpaceStep() or during a query.
Put these calls into a post-step callback.