Is it possible to apply different physics materials to various submeshes?

In the Unity editor I can easily apply various materials to each submesh of my 3D model. However, the Physics Materials are applied to my Mesh Collider and the Collider doesn’t divide itself the same way.
Is there a way to divide the submeshes of a 3D model inside the editor (or via script) to separate Colliders so that I can have various Physics Materials with the same object?

I managed to implement this using Unity’s modifiable contact pair physics callback.
Here’s the gist link. I just implemented it yesterday buy I am thinking of using this for my procedural terrain generator as well.

Unfortunately that’s not possible. Each Collider can have only one PhysicMaterial, so multiple physic materials require multiple meshes. Possible options:

  • Subdivide your mesh
  • Create a subdivided copy of your mesh, then use it as colliders only.
  • Make a script that extract the submeshes out of the visual mesh, then creates the corresponding colliders per each submesh. The Unity API exposes all you need (MeshCollider, MeshFilter, Mesh).