How do you change Friction on a collider material?

I’m trying to make a universal function for changing the friction on any object whether it has a sphere collider, box collider, mesh collider, or capsule collider.

This is not working for a box resting on a tilted plane.

function changeFriction(go:GameObject,amount:float);
//var go=GameObject.Find("box1");
go.GetComponent(Collider).material.staticFriction=amount;
go.GetComponent(Collider).material.dynamicFriction=amount;
go.GetComponent(Collider).material.frictionCombine=PhysicMaterialCombine.Minimum;
}

I would expect changeFriction(0) to make the box have zero friction and slide off the plane, but it doesn’t change the friction.

It only seems to work if I set the plane to have zero friction also and use BoxCollider instead of Collider.

Is there a way to make a universal friction changer for any type of collider and without adjusting the plane friction each time?

@dansav You can try by using PhysicsMaterial, it can help you to make and adjust differnet friction values of your colliders.