Customize body collision response

Godot Version

4.2.1

Question

Not sure the correct way to ask this one. I would like to customize the default behavior of a StaticBody3D, when a RigidBody/CharacterBody is colliding with it. For example let’s say a RigidBody3D falls onto a StaticBody3D. By default, the rigid body would hit the static body and stop. I could disable this by setting the StaticBody’s collision layer to one that is outside the rigid body’s mask. But I would instead like to disable this with custom code - preferably on the StaticBody side, in a script that derives from StaticBody3D. I would like to respond when the collision should occur, and do my own custom calculation to determine whether the collision should occur or not - essentially doing the same job as the layer/mask system but with my own code. Thanks for any help!