---
title: Equals
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/equals
latest_url: https://docs.unity.com/en-us/engine/7000.0/script-reference/unity/ai/navigation/lowlevel/navnode/equals.md
last_updated: 2026-11-30
generated_at: 2026-12-01T01:33:54.941Z
locale: en-us
---

# Equals

> Checks whether this NavNode refers to the same navigation node as another.

## Definition

* **Type:** Method
* **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)

## Equals(NavNode)

Checks whether this `NavNode` refers to the same navigation node as another.

```csharp
public readonly bool Equals(NavNode other)
```

### Parameters

**** (\[NavNode]\(/engine/7000.0/script-reference/unity/ai/navigation/lowlevel/navnode)): A `NavNode` to compare this one with.

### Returns

| Type                                                          | Description                                                                            |
| ------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | `true` if two `NavNode` objects refer to the same NavMesh node, and `false` otherwise. |

### Remarks

The comparison uses the internal identifier of the node. Two [NavNode](/engine/7000.0/script-reference/unity/ai/navigation/lowlevel/navnode.md) values are equal even if they refer to a node that has since been removed from the NavMesh, because the identifier itself doesn't change. Use [NavWorld.IsValid](/engine/7000.0/script-reference/unity/ai/navigation/lowlevel/navworld/isvalid.md) to determine whether the node is still active in the NavMesh.

### Examples

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

// Move the gameobject and see whether it maps to a different NavMesh node
public class NavNodeEqualsExample : MonoBehaviour
{
    Vector3 m_Anchor;

    void OnEnable()
    {
        m_Anchor = transform.position;
    }

    void Update()
    {
        using NavWorld world = NavWorld.GetDefaultWorld();
        NavLocation here = world.MapLocation(transform.position, 5f * Vector3.one, -1);
        NavLocation there = world.MapLocation(m_Anchor, 5f * Vector3.one, -1);
        if (world.IsValid(here) && world.IsValid(there))
        {
            bool sameNode = here.node.Equals(there.node);
            Debug.DrawLine(here.position, there.position, sameNode ? Color.green : Color.orange);
        }
        else
        {
            Debug.DrawLine(transform.position, m_Anchor, Color.red);
        }

        if (Time.frameCount % 100 == 0)
            m_Anchor = transform.position;
    }
}
```

## Equals(Object)

Checks whether this `NavNode` refers to the same navigation node as another.

```csharp
public override readonly bool Equals(object obj)
```

### Parameters

**** (\[Object]\(https\://learn.microsoft.com/dotnet/api/system.object)): An object to interpret as a `NavNode` and to compare this one with.

### Returns

| Type                                                          | Description                                                                            |
| ------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | `true` if two `NavNode` objects refer to the same NavMesh node, and `false` otherwise. |

### Remarks

The comparison uses the internal identifier of the node. Two [NavNode](/engine/7000.0/script-reference/unity/ai/navigation/lowlevel/navnode.md) values are equal even if they refer to a node that has since been removed from the NavMesh, because the identifier itself doesn't change. Use [NavWorld.IsValid](/engine/7000.0/script-reference/unity/ai/navigation/lowlevel/navworld/isvalid.md) to determine whether the node is still active in the NavMesh.

### Examples

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

// Move the gameobject and see whether it maps to a different NavMesh node
public class NavNodeEqualsExample : MonoBehaviour
{
    Vector3 m_Anchor;

    void OnEnable()
    {
        m_Anchor = transform.position;
    }

    void Update()
    {
        using NavWorld world = NavWorld.GetDefaultWorld();
        NavLocation here = world.MapLocation(transform.position, 5f * Vector3.one, -1);
        NavLocation there = world.MapLocation(m_Anchor, 5f * Vector3.one, -1);
        if (world.IsValid(here) && world.IsValid(there))
        {
            bool sameNode = here.node.Equals(there.node);
            Debug.DrawLine(here.position, there.position, sameNode ? Color.green : Color.orange);
        }
        else
        {
            Debug.DrawLine(transform.position, m_Anchor, Color.red);
        }

        if (Time.frameCount % 100 == 0)
            m_Anchor = transform.position;
    }
}
```
