<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/pathfinding-in-2d-unity-navmesh-tutorial--o0na4lnv5" -->

---
title: Pathfinding in 2D! (Unity NavMesh Tutorial) | daily.dev
description: A hands-on tutorial demonstrates how to set up 2D pathfinding in Unity, which lacks native support for 2D NavMesh since its built-in navigation system is...
canonical: https://daily.dev/posts/pathfinding-in-2d-unity-navmesh-tutorial--o0na4lnv5
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Pathfinding in 2D! (Unity NavMesh Tutorial) | daily.dev
og:description: A hands-on tutorial demonstrates how to set up 2D pathfinding in Unity, which lacks native support for 2D NavMesh since its built-in navigation system is...
og:url: https://daily.dev/posts/pathfinding-in-2d-unity-navmesh-tutorial--o0na4lnv5
og:image: https://api.daily.dev/og/posts/O0na4LNV5.png
og:image:alt: Pathfinding in 2D! (Unity NavMesh Tutorial)
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Pathfinding in 2D! (Unity NavMesh Tutorial)

**[Code Monkey](https://daily.dev/sources/codemonkeyunity)** · 13 min read · 0 upvotes · 0 comments

## Summary

A hands-on tutorial demonstrates how to set up 2D pathfinding in Unity, which lacks native support for 2D NavMesh since its built-in navigation system is designed for 3D. The walkthrough uses Unity's AI Navigation package alongside the community-made NavMeshPlus package to enable 2D navigation, covering NavMesh surface setup, baking walkable/unwalkable areas with colliders, configuring the NavMeshAgent for 2D movement and rotation (using AgentOverride2D and RotateSmooth2D components), and tuning agent radius/height settings for 2D scale. The result is characters that navigate around walls in a 2D spaceship scene, avoiding obstacles automatically.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=v_r7CpJ-Llo>

## Questions this post answers

### How do I set up 2D pathfinding in Unity since NavMesh only supports 3D by default?

Install Unity's AI Navigation package from the Unity registry, then add the community NavMeshPlus package by unpacking it into your project assets. Use the Navigation Surface component instead of NavMesh Surface, add Collect Sources 2D, and rotate the transform to the XY axis when prompted. This combination enables full 2D NavMesh baking and pathfinding.

_Developers wiring up 2D navigation systems can find implementation walkthroughs like this through daily.dev._

### Why is my 2D character invisible or facing the wrong way when using a NavMeshAgent in Unity?

The NavMeshAgent points Z-up by default because NavMesh is built for 3D, so a 2D sprite ends up rotated incorrectly and can appear invisible from the 2D camera view. Adding the Agent Override 2D component from the NavMeshPlus package fixes the orientation to face the XY axis, and adding Rotate 2D or Rotate Smooth 2D restores proper rotation during movement.

_Anyone debugging odd NavMeshAgent rotation issues in 2D can track fixes like this via daily.dev._

### What NavMesh agent radius and height values should I use for a 2D Unity game?

Default NavMesh agent settings of 0.5 radius and 2 height are tuned for 3D scale and are far too large for typical 2D scenes, causing large gaps between walls and the walkable area. Reducing radius to around 0.05, height to 0.1, and step height to 0.05 produces accurate walkable boundaries that hug wall colliders correctly in a 2D scene.

_Teams tuning agent settings for 2D pathfinding often compare configuration tips like this on daily.dev._

---

Tags: [#game-development](https://daily.dev/tags/game-development), [#unity](https://daily.dev/tags/unity)

[View this post on daily.dev](https://daily.dev/posts/pathfinding-in-2d-unity-navmesh-tutorial--o0na4lnv5)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Pathfinding in 2D! (Unity NavMesh Tutorial)","url":"https://daily.dev/posts/pathfinding-in-2d-unity-navmesh-tutorial--o0na4lnv5","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/pathfinding-in-2d-unity-navmesh-tutorial--o0na4lnv5"},"datePublished":"2026-09-19T15:22:46.392Z","dateModified":"2026-09-19T15:23:09.945Z","description":"A hands-on tutorial demonstrates how to set up 2D pathfinding in Unity, which lacks native support for 2D NavMesh since its built-in navigation system is...","image":"https://i.ytimg.com/vi/v_r7CpJ-Llo/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/v_r7CpJ-Llo/sddefault.jpg","isAccessibleForFree":true,"articleSection":"Code Monkey","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Code Monkey","logo":"https://media.daily.dev/image/upload/s--mgoqDIgw--/f_auto/v1727446687/logos/codemonkeyunity","url":"https://daily.dev/sources/codemonkeyunity"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/pathfinding-in-2d-unity-navmesh-tutorial--o0na4lnv5","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"game-development,unity","timeRequired":"PT13M","video":{"@type":"VideoObject","name":"Pathfinding in 2D! (Unity NavMesh Tutorial)","description":"A hands-on tutorial demonstrates how to set up 2D pathfinding in Unity, which lacks native support for 2D NavMesh since its built-in navigation system is...","thumbnailUrl":"https://i.ytimg.com/vi/v_r7CpJ-Llo/sddefault.jpg","uploadDate":"2026-09-19T15:22:46.392Z","duration":"PT13M","url":"https://api.daily.dev/r/O0na4LNV5","embedUrl":"https://www.youtube.com/embed/v_r7CpJ-Llo"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Code Monkey","item":"https://daily.dev/sources/codemonkeyunity"},{"@type":"ListItem","position":3,"name":"Pathfinding in 2D! (Unity NavMesh Tutorial)"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/pathfinding-in-2d-unity-navmesh-tutorial--o0na4lnv5#faq","mainEntity":[{"@type":"Question","name":"How do I set up 2D pathfinding in Unity since NavMesh only supports 3D by default?","acceptedAnswer":{"@type":"Answer","text":"Install Unity's AI Navigation package from the Unity registry, then add the community NavMeshPlus package by unpacking it into your project assets. Use the Navigation Surface component instead of NavMesh Surface, add Collect Sources 2D, and rotate the transform to the XY axis when prompted. This combination enables full 2D NavMesh baking and pathfinding. Developers wiring up 2D navigation systems can find implementation walkthroughs like this through daily.dev."}},{"@type":"Question","name":"Why is my 2D character invisible or facing the wrong way when using a NavMeshAgent in Unity?","acceptedAnswer":{"@type":"Answer","text":"The NavMeshAgent points Z-up by default because NavMesh is built for 3D, so a 2D sprite ends up rotated incorrectly and can appear invisible from the 2D camera view. Adding the Agent Override 2D component from the NavMeshPlus package fixes the orientation to face the XY axis, and adding Rotate 2D or Rotate Smooth 2D restores proper rotation during movement. Anyone debugging odd NavMeshAgent rotation issues in 2D can track fixes like this via daily.dev."}},{"@type":"Question","name":"What NavMesh agent radius and height values should I use for a 2D Unity game?","acceptedAnswer":{"@type":"Answer","text":"Default NavMesh agent settings of 0.5 radius and 2 height are tuned for 3D scale and are far too large for typical 2D scenes, causing large gaps between walls and the walkable area. Reducing radius to around 0.05, height to 0.1, and step height to 0.05 produces accurate walkable boundaries that hug wall colliders correctly in a 2D scene. Teams tuning agent settings for 2D pathfinding often compare configuration tips like this on daily.dev."}}]}
```

