# localToWorldMatrix

> The transformation matrix used to transform the Collider physics shapes to world space.

## Definition

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

```csharp
public Matrix4x4 localToWorldMatrix { get; }
```

### Remarks

The [Collider2D](/engine/6000.0/script-reference/unityengine/collider2d.md) creates [PhysicsShape2D](/engine/6000.0/script-reference/unityengine/physicsshape2d.md) in the space of any attached [Rigidbody2D](/engine/6000.0/script-reference/unityengine/rigidbody2d.md). The transformation matrix returned here transforms these shapes from the [Rigidbody2D](/engine/6000.0/script-reference/unityengine/rigidbody2d.md)'s local space to world space.

If the [Collider2D](/engine/6000.0/script-reference/unityengine/collider2d.md) is not attached to a [Rigidbody2D](/engine/6000.0/script-reference/unityengine/rigidbody2d.md) then [Matrix4x4.identity](/engine/6000.0/script-reference/unityengine/matrix4x4/identity.md) is returned because the [Collider2D](/engine/6000.0/script-reference/unityengine/collider2d.md) is Static and the subsequently created [PhysicsShape2D](/engine/6000.0/script-reference/unityengine/physicsshape2d.md) will already be in world space.

Additional Resources: [Rigidbody2D.localToWorldMatrix](/engine/6000.0/script-reference/unityengine/rigidbody2d/localtoworldmatrix.md) and [Matrix4x4](/engine/6000.0/script-reference/unityengine/matrix4x4.md).
