---
title: operator ==(NavNode, NavNode)
product: Unity Editor
version: '7000.0'
latest_version: '7000.0'
status: This page documents version 7000.0. The latest version is 7000.0.
canonical: https://docs.unity.com/en-us/engine/7000.0/script-reference/unity/ai/navigation/lowlevel/navnode/op-equality
latest_url: https://docs.unity.com/en-us/engine/7000.0/script-reference/unity/ai/navigation/lowlevel/navnode/op-equality.md
last_updated: 2026-11-30
generated_at: 2026-12-01T01:33:59.930Z
locale: en-us
---

# operator ==(NavNode, NavNode)

> Returns true if two NavNode values refer to the same NavMesh node.

## Definition

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

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

### Parameters

**** (\[NavNode]\(/engine/7000.0/script-reference/unity/ai/navigation/lowlevel/navnode)): The `NavNode` on the left side of the operator.**** (\[NavNode]\(/engine/7000.0/script-reference/unity/ai/navigation/lowlevel/navnode)): The `NavNode` on the right side of the operator.

### Returns

| Type                                                          | Description                                                                                       |
| ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | `true` if the two `NavNode` values share the same identifier or are both null, `false` otherwise. |

### Remarks

This operator is a syntactic shortcut equivalent to calling [NavNode.Equals](/engine/7000.0/script-reference/unity/ai/navigation/lowlevel/navnode/equals.md). Use it inside expressions where the `==` syntax is more concise than an explicit method call. Two null [NavNode](/engine/7000.0/script-reference/unity/ai/navigation/lowlevel/navnode.md) values are considered equal.

Additional Resources: [NavNode.IsNull](/engine/7000.0/script-reference/unity/ai/navigation/lowlevel/navnode/isnull.md)

### Examples

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

// Move the GameObject and see how far it travels inside the closest NavMesh node
public class NavNodeEqualOperatorExample : MonoBehaviour
{
    NavNode m_Cached;
    Vector3 m_CachedEntryPoint;

    void Update()
    {
        using NavWorld world = NavWorld.GetDefaultWorld();
        NavLocation current = world.MapLocation(transform.position, 5f * Vector3.one, -1);
        if (!world.IsValid(current))
        {
            Debug.DrawRay(transform.position, Vector3.up, Color.red);
            return;
        }

        if (current.node == m_Cached)
        {
            // Still on the same node, so show how far it has travelled across it.
            Debug.DrawLine(m_CachedEntryPoint, current.position, Color.yellow);
            Debug.DrawLine(current.position, transform.position, Color.grey);
            return;
        }

        m_Cached = current.node;
        m_CachedEntryPoint = current.position;
    }
}
```
