These are notes to be aware of when upgrading projects from Unity 4 to Unity 5, if your project uses the AI/NavmeshA mesh that Unity generates to approximate the walkable areas and obstacles in your environment for path finding and AI-controlled navigation. More info
See in Glossary features.
Navmesh contour may look different due to changed partitioning - in cases with narrow corridor/doorways or similar - this can lead to a difference in connectivity. Solve the issue by tweaking the voxelA 3D pixel. More info
See in Glossary size for navmesh building.
Setting the destination for a NavMeshAgent doesn’t resume the agent after calling ‘Stop’ - call ‘Resume’ explicitly to resume the agent.
NavMeshAgent.updatePosition: When updatePosition is false and the agent transform is moved the agent position doesn’t change. Previously the agent position would be reset to the transform position - constrained to the nearby navmesh.
NavMeshObstacle component: The default shape for newly created NavMeshObstacle components is a box. The selected shape (box or capsule) now applies to both carving and avoidance.
Navmesh built with earlier versions of Unity is not supported. You must rebuild with Unity 5. You can use the following script as an example how to rebuild NavMesh data for all of you scenesA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary.
#if UNITY_EDITOR
using System.Collections.Generic;
using System.Collections;
using System.IO;
using UnityEditor;
using UnityEngine;
using UnityEngine.AI;
public class RebakeAllScenesEditorScript
{
[MenuItem ("Upgrade helper/Bake All Scenes")]
public static void Bake()
{
List<string> sceneNames = SearchFiles (Application.dataPath, "*.unity");
foreach (string f in sceneNames)
{
EditorApplication.OpenScene(f);
// Rebake navmesh data
NavMeshBuilder.BuildNavMesh ();
EditorApplication.SaveScene ();
}
}
static List<string> SearchFiles(string dir, string pattern)
{
List <string> sceneNames = new List <string>();
foreach (string f in Directory.GetFiles(dir, pattern, SearchOption.AllDirectories))
{
sceneNames.Add (f);
}
return sceneNames;
}
}
#endif
When you visit any website, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and change our default settings. However, blocking some types of cookies may impact your experience of the site and the services we are able to offer.
More information
These cookies enable the website to provide enhanced functionality and personalisation. They may be set by us or by third party providers whose services we have added to our pages. If you do not allow these cookies then some or all of these services may not function properly.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us to know which pages are the most and least popular and see how visitors move around the site. All information these cookies collect is aggregated and therefore anonymous. If you do not allow these cookies we will not know when you have visited our site, and will not be able to monitor its performance.
These cookies may be set through our site by our advertising partners. They may be used by those companies to build a profile of your interests and show you relevant adverts on other sites. They do not store directly personal information, but are based on uniquely identifying your browser and internet device. If you do not allow these cookies, you will experience less targeted advertising. Some 3rd party video providers do not allow video views without targeting cookies. If you are experiencing difficulty viewing a video, you will need to set your cookie preferences for targeting to yes if you wish to view videos from these providers. Unity does not control this.
These cookies are necessary for the website to function and cannot be switched off in our systems. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms. You can set your browser to block or alert you about these cookies, but some parts of the site will not then work. These cookies do not store any personally identifiable information.