# PolygonWorldToLocalMatrix(PolygonId)

> Returns the inverse transformation matrix of the NavMesh surface that contains the specified NavMesh node.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.Experimental.AI](/engine/6000.7/script-reference/unityengine/experimental/ai.md)
* **Assembly:** UnityEngine.AIModule

> **Warning:**
>
> **Deprecated.** The experimental NavMeshQuery struct has been deprecated. Use NavWorld instead.

```csharp
public Matrix4x4 PolygonWorldToLocalMatrix(PolygonId polygon)
```

### Parameters

**** (\[PolygonId]\(/engine/6000.7/script-reference/unityengine/experimental/ai/polygonid)): NavMesh node for which its owner's inverse transform must be determined.

### Returns

| Type                                                                  | Description                                                                |
| --------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| [Matrix4x4](/engine/6000.7/script-reference/unityengine/matrix4x4.md) | Inverse transformation matrix of the surface owning the specified polygon. |

### Remarks

In contrast to [NavMeshQuery.PolygonLocalToWorldMatrix](/engine/6000.7/script-reference/unityengine/experimental/ai/navmeshquery/polygonlocaltoworldmatrix.md) the returned matrix can be used for transforming a world-coordinates position into the local coordinate system of the NavMesh surface owning the specified polygon.

**Important:** This method does not return the inverse position and orientation of a single NavMesh polygon. It returns the inverse position and orientation of the surface that owns the polygon.

**Known issue:** Identity matrix is returned instead of the actual inverse transform for NavMeshLinks that have been instantiated with a call to [NavMesh.AddLink](/engine/6000.7/script-reference/unityengine/ai/navmesh/addlink.md)(linkData, position, rotation).

Additional Resources: [NavMeshQuery.GetPolygonType](/engine/6000.7/script-reference/unityengine/experimental/ai/navmeshquery/getpolygontype.md)
