Prevent pushing of rigidbody

I need to prevent two dynamic rigidbodies from pushing each other (but not to ignore each other). Solutions i found on this site are not suitable for my case, cause i only want to prevent pushing of two certain rigidbodies, but i also want for them to be affected by gravity and interact with other rigidbodies normally.

Hello, you may call Physics.IgnoreCollision(collider1, collider2, ignore: true) passing your two colliders. Here’s the link to the API