How to get the friction (factor) of the surface that the player is sliding on

I have a player that slides on different surfaces of increasing friction. What script can I write to get the friction that the player is currently colliding/sliding on?

175011-screenshot-2021-01-28-234335.png

You can get the properties of the Physics material assigned to your collider. For example:

BoxCollider col = GetComponent<BoxCollider>();

float dynamicFriction = col.material.dynamicFriction;
float staticFriction = col.material.staticFriction;

This works with all colliders with a physics material. @pnguin2