I have two object types:
This works fine. Collisions and contacts are detected.
If before the player collides with the ground, I set the category, collision and contact masks of the player to (0), then the player falls through the ground (this is also fine).
But if the player is standing on the ground (in contact), and then I change the category, collision and contact masks of the player to (0), then the player does not fall through the ground!
Does this mean we cannot change the bit masks if an object is in contact with something else ? I set the bitmasks by calling:
pb->setCategoryBitmask(_category); pb->setContactTestBitmask(_contact); pb->setCollisionBitmask(_collision);
Where pb is the PhysicsBody of the sprite, and _category,_contact,_collision are uint32_t representing the masks.