public PhysicsMaterial2D mat; GetComponent<Collider2D>().sharedMaterial = mat; // Sets material to mat