# sharedMaterial

> The PhysicsMaterial2D that is applied to this collider.

## Definition

* **Type:** Property
* **Namespace:** [UnityEngine](/engine/6000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.Physics2DModule

```csharp
public PhysicsMaterial2D sharedMaterial { get; set; }
```

### Remarks

If no [PhysicsMaterial2D](/engine/6000.0/script-reference/unityengine/physicsmaterial2d.md) is specified then the [Rigidbody2D.sharedMaterial](/engine/6000.0/script-reference/unityengine/rigidbody2d/sharedmaterial.md) on the [Rigidbody2D](/engine/6000.0/script-reference/unityengine/rigidbody2d.md) that the collider is attached to is used.  If the collider is not attached to a [Rigidbody2D](/engine/6000.0/script-reference/unityengine/rigidbody2d.md) or no [Rigidbody2D.sharedMaterial](/engine/6000.0/script-reference/unityengine/rigidbody2d/sharedmaterial.md) is specified then the global [PhysicsMaterial2D](/engine/6000.0/script-reference/unityengine/physicsmaterial2d.md) is used.  If no global [PhysicsMaterial2D](/engine/6000.0/script-reference/unityengine/physicsmaterial2d.md) is specified then the defaults are: [PhysicsMaterial2D.friction](/engine/6000.0/script-reference/unityengine/physicsmaterial2d/friction.md) = 0.4 and [PhysicsMaterial2D.bounciness](/engine/6000.0/script-reference/unityengine/physicsmaterial2d/bounciness.md) = 0.

In other words, a [PhysicsMaterial2D](/engine/6000.0/script-reference/unityengine/physicsmaterial2d.md) specified on the [Collider2D](/engine/6000.0/script-reference/unityengine/collider2d.md) has priority over a [PhysicsMaterial2D](/engine/6000.0/script-reference/unityengine/physicsmaterial2d.md) specified on a [Rigidbody2D](/engine/6000.0/script-reference/unityengine/rigidbody2d.md) which has priority over the global [PhysicsMaterial2D](/engine/6000.0/script-reference/unityengine/physicsmaterial2d.md).

Additional Resources: [Rigidbody2D.sharedMaterial](/engine/6000.0/script-reference/unityengine/rigidbody2d/sharedmaterial.md) & [PhysicsMaterial2D](/engine/6000.0/script-reference/unityengine/physicsmaterial2d.md).
