how to assign 2d physics material through script code example
Example: how to assign 2d physics material through script
public PhysicsMaterial2D mat;
GetComponent<Collider2D>().sharedMaterial = mat; // Sets material to mat
public PhysicsMaterial2D mat;
GetComponent<Collider2D>().sharedMaterial = mat; // Sets material to mat