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

# IsNull()

> Determines whether this NavNode is empty of any information.

## 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)

```csharp
public readonly bool IsNull()
```

### Returns

| Type                                                          | Description                                                                                                            |
| ------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | `true` if the `NavNode` has been created empty and has never pointed to any node in the NavMesh, or `false` otherwise. |

### Remarks

A null [NavNode](/engine/7000.0/script-reference/unity/ai/navigation/lowlevel/navnode.md) is the default value of the struct and represents the absence of a reference to any node. This is distinct from a `NavNode` that once referenced a real node that has since been removed; in that case `IsNull` still returns `false`. Use [NavWorld.IsValid](/engine/7000.0/script-reference/unity/ai/navigation/lowlevel/navworld/isvalid.md) to check whether a non-null node is currently active in the NavMesh.

### Examples

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

// Move the gameobject until it maps to a NavMesh polygon whose area type is not excluded
public class NavNodeIsNullExample : MonoBehaviour
{
    public int excludedAreaType = 0;
    NavLocation m_Stored;

    void Update()
    {
        using NavWorld world = NavWorld.GetDefaultWorld();

        if (m_Stored.node.IsNull())
        {
            int validAreaTypes = NavMesh.AllAreas & ~(1 << System.Math.Clamp(excludedAreaType, 0, 31));
            NavLocation location = world.MapLocation(transform.position, 0.3f * Vector3.one, -1, validAreaTypes);
            if (world.IsValid(location))
            {
                m_Stored = location;
            }

            Debug.DrawRay(transform.position, Vector3.up, Color.red);
            return;
        }

        Color statusColor = world.IsValid(m_Stored) ? Color.green : Color.yellow;
        Debug.DrawRay(m_Stored.position, Vector3.up, statusColor);
        Debug.DrawLine(transform.position, m_Stored.position, Color.gray);
    }

    void OnDisable()
    {
        m_Stored = new NavLocation();
    }
}
```
