Physics messages are sent between Physics or Physics2D bodies when their colliders interact.
Test that you receive a physics message by using a breakpoint or log.
Don't put breakpoints or logs after or inside other code when testing a method runs.
You likely have an error in your logic. Common mistakes include:
CompareTag to get proper warnings.gameObject, leading to the appearance that nothing happens.Both objects involved in a collision receive events.
If you only want one to run, compare the instance IDs of the objects involved in the collision using GetInstanceID:
// Exit early if this instance ID is less than the other object involved in the collision.
if (GetInstanceId() < collider.GetInstanceID())
return;