how to set item like coin in mario ?

I would like to set coin like in mario that have precollision with mario and disappear and enemy can pass through.

I have tried to set coin as static body that when mario near it, it would be disappeared like being eaten.

However, it would have collision with enemy.

Is it possible to set it no collision with enemy and only have collision with mario??

You need to look up Collision Filters.  This lets you set it so that collisions only happen between two classes of objects yet letting others ignore the collisions.

You need to look up Collision Filters.  This lets you set it so that collisions only happen between two classes of objects yet letting others ignore the collisions.