{"id":31884,"date":"2024-11-01T09:03:49","date_gmt":"2024-11-01T09:03:49","guid":{"rendered":"http:\/\/atmokpo.com\/w\/?p=31884"},"modified":"2024-11-01T11:34:17","modified_gmt":"2024-11-01T11:34:17","slug":"unity-basics-course-navigation","status":"publish","type":"post","link":"https:\/\/atmokpo.com\/w\/31884\/","title":{"rendered":"Unity Basics Course: Navigation"},"content":{"rendered":"<p>In game development, it is crucial for characters to automatically navigate paths and move to target points. This is made possible by Unity&#8217;s navigation system. In this tutorial, we will explain how to set up and utilize the navigation system in Unity in detail.<\/p>\n<h2>1. What is Navigation?<\/h2>\n<p>The navigation system is a technology that allows NPCs (Non-Player Characters) or player characters in a game to navigate complex terrains, avoid obstacles, and move to their destinations by themselves. Unity provides various tools and features necessary for navigation, helping game developers to easily implement this functionality.<\/p>\n<h3>1.1 The Necessity of Navigation<\/h3>\n<p>The navigation system is important for several reasons:<\/p>\n<ul>\n<li><strong>Automated Pathfinding:<\/strong> Instead of manually specifying character paths, AI can find paths on its own.<\/li>\n<li><strong>Obstacle Avoidance:<\/strong> The navigation system can automatically recognize and avoid obstacles.<\/li>\n<li><strong>Realism:<\/strong> NPCs move naturally, enhancing the immersion of the game.<\/li>\n<\/ul>\n<h2>2. Components of Unity&#8217;s Navigation System<\/h2>\n<p>The Unity navigation system consists of several components. Here, we will describe the main elements.<\/p>\n<h3>2.1 NavMesh<\/h3>\n<p>NavMesh defines the navigable area. This allows Unity to understand the range within which characters can move. NavMesh is the core of Unity&#8217;s navigation system. To create a NavMesh:<\/p>\n<ol>\n<li>A MeshCollider component is required for the game object.<\/li>\n<li>Go to Window &gt; AI &gt; Navigation to open the navigation window.<\/li>\n<li>In the &#8216;Bake&#8217; tab, bake the mesh to create the NavMesh.<\/li>\n<\/ol>\n<h3>2.2 NavMesh Agent<\/h3>\n<p>The NavMesh Agent is the component that allows characters to navigate along the NavMesh. This component allows you to set the character&#8217;s speed, rotation speed, collision handling, and more. To add a NavMesh Agent:<\/p>\n<ol>\n<li>Add the NavMesh Agent component to the character.<\/li>\n<li>Set properties such as speed, rotation speed, and path correction.<\/li>\n<\/ol>\n<h3>2.3 NavMesh Obstacle<\/h3>\n<p>The NavMesh Obstacle represents dynamic obstacles and helps agents avoid them. It automatically updates the path while moving to allow real-time obstacle avoidance.<\/p>\n<h2>3. Setting Up Navigation in Unity<\/h2>\n<p>Now we will set up the navigation system in Unity. We will explain the process step by step through a simple example.<\/p>\n<h3>3.1 Creating a New Project<\/h3>\n<p>Open Unity and create a new 3D project. Set an appropriate name and start the project.<\/p>\n<h3>3.2 Creating Terrain<\/h3>\n<p>Add terrain and place movable obstacles and paths. Specifically, you can create terrain by selecting &#8216;Terrain&#8217; from the &#8216;3D Object&#8217; menu.<\/p>\n<h3>3.3 Generating NavMesh<\/h3>\n<p>Once the terrain is ready, click &#8216;Window &gt; AI &gt; Navigation&#8217; to open the navigation window, go to the &#8216;Bake&#8217; tab, and click the &#8216;Bake&#8217; button to generate the NavMesh.<\/p>\n<h3>3.4 Adding NavMesh Agent<\/h3>\n<p>Select the character object, click &#8216;Add Component&#8217;, search for &#8216;NavMesh Agent&#8217;, and add it. Set the necessary properties.<\/p>\n<h3>3.5 Setting the Path<\/h3>\n<p>Write a script to set the character to move to the target point. Create a new C# script and add the following code:<\/p>\n<pre><code>\nusing UnityEngine;\nusing UnityEngine.AI;\n\npublic class MoveToTarget : MonoBehaviour\n{\n    public Transform target; \/\/ Target point\n    private NavMeshAgent agent;\n\n    void Start()\n    {\n        agent = GetComponent&lt;NavMeshAgent&gt;();\n        agent.destination = target.position; \/\/ Move to the target point\n    }\n}\n<\/code><\/pre>\n<h3>3.6 Testing<\/h3>\n<p>Run the game to check if the character moves along the set path to the target point.<\/p>\n<h2>4. Advanced Navigation Features<\/h2>\n<p>The Unity navigation system offers advanced features. By utilizing these features well, you can implement more realistic behaviors.<\/p>\n<h3>4.1 Dynamic Obstacle Handling<\/h3>\n<p>Using NavMesh Obstacles allows characters to react dynamically when obstacles are created or removed during gameplay. This enables more vibrant gameplay.<\/p>\n<h3>4.2 Setting Multiple Targets<\/h3>\n<p>You can configure agents with multiple target points to implement complex behavior patterns. For example, NPCs can randomly select target points to move to.<\/p>\n<h2>5. Performance Optimization<\/h2>\n<p>Performance optimization is important when using the navigation system. Careful consideration is needed regarding the size and usage of NavMeshes. Using too many NavMeshes can impact game performance.<\/p>\n<h3>5.1 NavMesh Baking Optimization<\/h3>\n<p>When baking NavMesh, attention should be paid to the complexity of the mesh. Removing unnecessary detailed features can improve performance.<\/p>\n<h3>5.2 Adjusting Agent Speed<\/h3>\n<p>Adjusting each agent&#8217;s speed can reduce unnecessary loading. Set the speed to ensure that agents do not move too quickly to reach the target point.<\/p>\n<h2>6. Conclusion<\/h2>\n<p>The Unity navigation system is a very important element in game development. Through this tutorial, we learned the basic concepts of navigation, how to set it up, advanced features, and performance optimization. Create an engaging and realistic game environment using various features. For deeper insights, please refer to the official Unity documentation.<\/p>\n<p>We support your learning of Unity navigation!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In game development, it is crucial for characters to automatically navigate paths and move to target points. This is made possible by Unity&#8217;s navigation system. In this tutorial, we will explain how to set up and utilize the navigation system in Unity in detail. 1. What is Navigation? The navigation system is a technology that &hellip; <a href=\"https:\/\/atmokpo.com\/w\/31884\/\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;Unity Basics Course: Navigation&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[135],"tags":[],"class_list":["post-31884","post","type-post","status-publish","format-standard","hentry","category-unity-basic"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Unity Basics Course: Navigation - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/atmokpo.com\/w\/31884\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Unity Basics Course: Navigation - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"og:description\" content=\"In game development, it is crucial for characters to automatically navigate paths and move to target points. This is made possible by Unity&#8217;s navigation system. In this tutorial, we will explain how to set up and utilize the navigation system in Unity in detail. 1. What is Navigation? The navigation system is a technology that &hellip; \ub354 \ubcf4\uae30 &quot;Unity Basics Course: Navigation&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/atmokpo.com\/w\/31884\/\" \/>\n<meta property=\"og:site_name\" content=\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-01T09:03:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-01T11:34:17+00:00\" \/>\n<meta name=\"author\" content=\"root\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@bebubo4\" \/>\n<meta name=\"twitter:site\" content=\"@bebubo4\" \/>\n<meta name=\"twitter:label1\" content=\"\uae00\uc4f4\uc774\" \/>\n\t<meta name=\"twitter:data1\" content=\"root\" \/>\n\t<meta name=\"twitter:label2\" content=\"\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04\" \/>\n\t<meta name=\"twitter:data2\" content=\"4\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/atmokpo.com\/w\/31884\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/31884\/\"},\"author\":{\"name\":\"root\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\"},\"headline\":\"Unity Basics Course: Navigation\",\"datePublished\":\"2024-11-01T09:03:49+00:00\",\"dateModified\":\"2024-11-01T11:34:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/atmokpo.com\/w\/31884\/\"},\"wordCount\":692,\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"articleSection\":[\"Unity Basic\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/atmokpo.com\/w\/31884\/\",\"url\":\"https:\/\/atmokpo.com\/w\/31884\/\",\"name\":\"Unity Basics Course: Navigation - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#website\"},\"datePublished\":\"2024-11-01T09:03:49+00:00\",\"dateModified\":\"2024-11-01T11:34:17+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/atmokpo.com\/w\/31884\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/atmokpo.com\/w\/31884\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/atmokpo.com\/w\/31884\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\/\/atmokpo.com\/w\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Unity Basics Course: Navigation\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/atmokpo.com\/w\/#website\",\"url\":\"https:\/\/atmokpo.com\/w\/\",\"name\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/atmokpo.com\/w\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\",\"name\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"url\":\"https:\/\/atmokpo.com\/w\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png\",\"contentUrl\":\"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png\",\"width\":400,\"height\":400,\"caption\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\"},\"image\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/bebubo4\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\",\"name\":\"root\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g\",\"caption\":\"root\"},\"sameAs\":[\"http:\/\/atmokpo.com\/w\"],\"url\":\"https:\/\/atmokpo.com\/w\/author\/root\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Unity Basics Course: Navigation - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/atmokpo.com\/w\/31884\/","og_locale":"ko_KR","og_type":"article","og_title":"Unity Basics Course: Navigation - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","og_description":"In game development, it is crucial for characters to automatically navigate paths and move to target points. This is made possible by Unity&#8217;s navigation system. In this tutorial, we will explain how to set up and utilize the navigation system in Unity in detail. 1. What is Navigation? The navigation system is a technology that &hellip; \ub354 \ubcf4\uae30 \"Unity Basics Course: Navigation\"","og_url":"https:\/\/atmokpo.com\/w\/31884\/","og_site_name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","article_published_time":"2024-11-01T09:03:49+00:00","article_modified_time":"2024-11-01T11:34:17+00:00","author":"root","twitter_card":"summary_large_image","twitter_creator":"@bebubo4","twitter_site":"@bebubo4","twitter_misc":{"\uae00\uc4f4\uc774":"root","\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04":"4\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/atmokpo.com\/w\/31884\/#article","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/31884\/"},"author":{"name":"root","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7"},"headline":"Unity Basics Course: Navigation","datePublished":"2024-11-01T09:03:49+00:00","dateModified":"2024-11-01T11:34:17+00:00","mainEntityOfPage":{"@id":"https:\/\/atmokpo.com\/w\/31884\/"},"wordCount":692,"publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"articleSection":["Unity Basic"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/atmokpo.com\/w\/31884\/","url":"https:\/\/atmokpo.com\/w\/31884\/","name":"Unity Basics Course: Navigation - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/#website"},"datePublished":"2024-11-01T09:03:49+00:00","dateModified":"2024-11-01T11:34:17+00:00","breadcrumb":{"@id":"https:\/\/atmokpo.com\/w\/31884\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/atmokpo.com\/w\/31884\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/atmokpo.com\/w\/31884\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/atmokpo.com\/w\/en\/"},{"@type":"ListItem","position":2,"name":"Unity Basics Course: Navigation"}]},{"@type":"WebSite","@id":"https:\/\/atmokpo.com\/w\/#website","url":"https:\/\/atmokpo.com\/w\/","name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","description":"","publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/atmokpo.com\/w\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Organization","@id":"https:\/\/atmokpo.com\/w\/#organization","name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","url":"https:\/\/atmokpo.com\/w\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/","url":"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png","contentUrl":"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png","width":400,"height":400,"caption":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8"},"image":{"@id":"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/bebubo4"]},{"@type":"Person","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7","name":"root","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g","caption":"root"},"sameAs":["http:\/\/atmokpo.com\/w"],"url":"https:\/\/atmokpo.com\/w\/author\/root\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/31884","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/comments?post=31884"}],"version-history":[{"count":1,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/31884\/revisions"}],"predecessor-version":[{"id":31885,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/31884\/revisions\/31885"}],"wp:attachment":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/media?parent=31884"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/categories?post=31884"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/tags?post=31884"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}