<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/NavigationComponent",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation19NavigationComponentV"
  },
  "title" : "NavigationComponent"
}
-->

# NavigationComponent

A component that defines which areas of a navigation mesh an entity can move through.

```
struct NavigationComponent
```

## Overview

Add a navigation component to an entity to make it a navigation agent. Its
[`layer`](/documentation/RealityKit/NavigationComponent/layer) selects the navigation mesh the entity travels on,
and its [`filter`](/documentation/RealityKit/NavigationComponent/filter-swift.property) restricts which marked
areas the entity can cross when a [`NavigationController`](/documentation/RealityKit/NavigationController) finds a path.

## Topics

### Creating a component

[`init(layer:filter:)`](/documentation/RealityKit/NavigationComponent/init(layer:filter:))

### Configuring navigation

[`layer`](/documentation/RealityKit/NavigationComponent/layer)

The layer to use when searching for a NavigationMeshResource in a Scene. If not set, the first available NavigationMeshResource will be used.

[`filter`](/documentation/RealityKit/NavigationComponent/filter-swift.property)

The filter to use when pathfinding.

[`NavigationComponent.Filter`](/documentation/RealityKit/NavigationComponent/Filter-swift.struct)

A struct that stores information about flags to ignore and include, and area costs for a pathfind.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)