---
title: operator ==(NavQueryBuffer, NavQueryBuffer)
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/navquerybuffer/op-equality
latest_url: https://docs.unity.com/en-us/engine/7000.0/script-reference/unity/ai/navigation/lowlevel/navquerybuffer/op-equality.md
last_updated: 2026-11-30
generated_at: 2026-12-01T01:18:33.589Z
locale: en-us
---

# operator ==(NavQueryBuffer, NavQueryBuffer)

> Checks whether two NavQueryBuffer values refer to the same underlying pathfinding buffer.

## 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 ==(NavQueryBuffer left, NavQueryBuffer right)
```

### Parameters

**** (\[NavQueryBuffer]\(/engine/7000.0/script-reference/unity/ai/navigation/lowlevel/navquerybuffer)): The first [NavQueryBuffer](/engine/7000.0/script-reference/unity/ai/navigation/lowlevel/navquerybuffer.md) to compare.**** (\[NavQueryBuffer]\(/engine/7000.0/script-reference/unity/ai/navigation/lowlevel/navquerybuffer)): The second `NavQueryBuffer` to compare.

### Returns

| Type                                                          | Description                                                                                 |
| ------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | `true` if the two `NavQueryBuffer` values point to the same allocation. Otherwise, `false`. |

### Remarks

This operator is a syntactic shortcut equivalent to calling [NavQueryBuffer.Equals](/engine/7000.0/script-reference/unity/ai/navigation/lowlevel/navquerybuffer/equals.md). Use it inside expressions where the `==` syntax is more concise than an explicit method call. The comparison only succeeds when both values point to the same allocation in memory.

### Examples

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

// Attach this script to a GameObject and enter Play mode. The Console shows a message because
// both variables refer to the same NavQueryBuffer allocation.
public class NavQueryBufferEqualOperatorExample : MonoBehaviour
{
    void OnEnable()
    {
        using NavWorld world = NavWorld.GetDefaultWorld();
        NavQueryBuffer original = new NavQueryBuffer(world, Allocator.Persistent, 1024);
        NavQueryBuffer alias = original;

        if (original == alias)
            Debug.Log("Both variables alias the same NavQueryBuffer allocation.");

        original.Dispose();
    }
}
```
