cocos2d-x how to remove a physics body

I am a newbie on cocos2d-x development. I get myself understood about how to use the following method to attach a physicsBody to a sprite.
this->setPhysicsBody(physicsBody);

I am wondering if there is a method to removePhysicsBody from a sprite?

Thanks,

Kevin

Only if this is your Sprite Node.

With this->getPhysicsBody()->removeFromPhysicsWorld();.

Thank you. That saved my day.

hi,
I have an additional issue with this,
after call removeFromPhysicsWorld()
getPhysicsBody() return is not NULL
could you try to check this is bug or not?

It’s not a bug. The physics body is only removed from the physics world, not destroyed. It is still attached to your sprite.