# GetInstanceTransform(NavNode, out Vector3, out Quaternion)

> Retrieves the position and rotation of the NavMesh surface that contains the specified NavMesh node.

## Definition

* **Type:** Method
* **Namespace:** [Unity.AI.Navigation.LowLevel](/engine/6000.5/script-reference/unity/ai/navigation/lowlevel.md)
* **Assembly:** UnityEngine.AIModule

## GetInstanceTransform(NavNode, Vector3, Quaternion)

```csharp
public readonly void GetInstanceTransform(NavNode node, out Vector3 position, out Quaternion rotation)
```

### Parameters

**** (\[NavNode]\(/engine/6000.5/script-reference/unity/ai/navigation/lowlevel/navnode)): The NavMesh node whose owner's transform to retrieve.**** (\[Vector3]\(/engine/6000.5/script-reference/unityengine/vector3)): Outputs the world position of the NavMesh surface that owns the specified node.This is a zero vector when the NavMesh node is a NavMesh Link.**** (\[Quaternion]\(/engine/6000.5/script-reference/unityengine/quaternion)): Outputs the world rotation of the NavMesh surface that owns the specified node.This is [Quaternion.identity](/engine/6000.5/script-reference/unityengine/quaternion/identity.md) when the NavMesh node is a NavMesh Link.

### Remarks

Unity defines the transform of a [NavMeshData](/engine/6000.5/script-reference/unityengine/ai/navmeshdata.md) surface from the `position` and `rotation` values that you declare when you bake the surface with BuildNavMeshData, or as part of a NavMesh Surface, or when you explicitly set the values for [NavMeshData.position](/engine/6000.5/script-reference/unityengine/ai/navmeshdata/position.md) and [NavMeshData.rotation](/engine/6000.5/script-reference/unityengine/ai/navmeshdata/rotation.md).

You can also specify custom transforms for [NavMeshDataInstances](/engine/6000.5/script-reference/unityengine/ai/navmeshdatainstance.md) when you create them, by passing explicit `position` and `rotation` values to the [NavMesh.AddNavMeshData](/engine/6000.5/script-reference/unityengine/ai/navmesh/addnavmeshdata.md) method.

**Important**: This method doesn't return the position and orientation of a single NavMesh polygon. It returns the position of the surface that owns the polygon.

**Note**: This method returns zero and identity instead of the actual transform for NavMesh Links that you instantiate with a call to [NavMesh.AddLink](/engine/6000.5/script-reference/unityengine/ai/navmesh/addlink.md).

Additional Resources: [NavWorld.GetNodeType](/engine/6000.5/script-reference/unity/ai/navigation/lowlevel/navworld/getnodetype.md)

### Examples

```csharp
using UnityEngine;
using Unity.AI.Navigation.LowLevel;

public class InstanceTransformExample : MonoBehaviour
{
    void Update()
    {
        using NavWorld world = NavWorld.GetDefaultWorld();
        NavLocation location = world.MapLocation(transform.position, Vector3.one, 0);
        if (!world.IsValid(location))
            return;

        world.GetInstanceTransform(location.node, out Vector3 surfacePosition, out Quaternion surfaceRotation);
        Debug.DrawRay(surfacePosition, surfaceRotation * Vector3.up, Color.yellow);
    }
}
```
