# sharedMaterial

> The PhysicsMaterial2D that is applied to all Collider2D attached to this Rigidbody2D.

## Definition

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

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

### Remarks

The [PhysicsMaterial2D](/engine/6000.0/script-reference/unityengine/physicsmaterial2d.md) specified here is applied to all attached [Collider2D](/engine/6000.0/script-reference/unityengine/collider2d.md) unless the [Collider2D](/engine/6000.0/script-reference/unityengine/collider2d.md) specify their own [PhysicsMaterial2D](/engine/6000.0/script-reference/unityengine/physicsmaterial2d.md) in [Collider2D.sharedMaterial](/engine/6000.0/script-reference/unityengine/collider2d/sharedmaterial.md).  If no [Collider2D.sharedMaterial](/engine/6000.0/script-reference/unityengine/collider2d/sharedmaterial.md) or [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: [Collider2D.sharedMaterial](/engine/6000.0/script-reference/unityengine/collider2d/sharedmaterial.md) & [PhysicsMaterial2D](/engine/6000.0/script-reference/unityengine/physicsmaterial2d.md).
