Deactivating a Sprite*

How can I deactivate a Sprite* in a way that the Sprite* will not be drawn and all physics on the Sprite* to others has no effect?

Assuming you’re using Chipmunk, you can call getPhysicsBody()->setEnabled(false).
As for no drawing you can call setVisible(false) or removeFromParentWithCleanup(false). <- giving false will not destroy the sprite, so you can add it as a child again later.

2 Likes

I did the setVisible(false) on the physics body thanx!