Conditional Collision with Physics Engine

Hi guys? I’m making a block breaking game with my co-workers right now. We’re using the physics engine (Box2d) to check for collisions and use the logic to reduce the block’s health whenever it collides.

While making this time, I needed an additional function, and if the block collides with 1 health and becomes 0, I want to make a function that passes through the projectile rather than colliding with the block. So a block with 1 hit point can pass through it without colliding.

How can I make this function work?

I’m not sure to have well understood you question, can you disable the rigidbody of that element when it’s health is 1 ?