# operator ==(NavLocation, NavLocation)

> Checks whether two NavLocation objects have the same position and refer to the same NavMesh node.

## Definition

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

```csharp
public static bool operator ==(NavLocation left, NavLocation right)
```

### Parameters

**** (\[NavLocation]\(/engine/6000.5/script-reference/unity/ai/navigation/lowlevel/navlocation)): The [NavLocation](/engine/6000.5/script-reference/unity/ai/navigation/lowlevel/navlocation.md) on the left side of the operator.**** (\[NavLocation]\(/engine/6000.5/script-reference/unity/ai/navigation/lowlevel/navlocation)): The [NavLocation](/engine/6000.5/script-reference/unity/ai/navigation/lowlevel/navlocation.md) on the right side of the operator.

### Returns

| Type                                                          | Description                                                                                                                                                              |
| ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | `true` if the two [NavLocation](/engine/6000.5/script-reference/unity/ai/navigation/lowlevel/navlocation.md) values share the same node and position, `false` otherwise. |

### Remarks

This operator is a syntactic shortcut equivalent to calling [NavLocation.Equals](/engine/6000.5/script-reference/unity/ai/navigation/lowlevel/navlocation/equals.md). Use it inside expressions where the `==` syntax is more concise than an explicit method call. Both the [position](/engine/6000.5/script-reference/unity/ai/navigation/lowlevel/navlocation/position.md) and the [node](/engine/6000.5/script-reference/unity/ai/navigation/lowlevel/navlocation/node.md) are compared.

### Examples

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

public class NavLocationEqualOperatorExample : MonoBehaviour
{
    NavLocation m_Previous;

    void Update()
    {
        using NavWorld world = NavWorld.GetDefaultWorld();
        NavLocation current = world.MapLocation(transform.position, Vector3.one, 0);
        if (current == m_Previous)
            Debug.Log("Agent has not moved to a new NavMesh location.");
        m_Previous = current;
    }
}
```
