다음은 프로젝트에서 AI/내비메시 기능을 사용하는 경우 Unity 4에서 Unity 5로 프로젝트를 업그레이드할 때 주의해야 하는 참고 사항입니다.
파티션 변경(좁은 통로/출입구 또는 유사 사례) 때문에 내비메시 윤곽이 달라 보일 수 있으며, 연결성에 차이를 가져올 수 있습니다. 내비메시 빌드의 복셀 크기를 미세 조정하여 문제를 해결할 수 있습니다.
NavMeshAgent는 ‘Stop’ 함수를 호출한 후 대상을 설정해도 에이전트의 움직임이 다시 이어지지 않습니다. 다시 움직이도록 하려면 ‘Resume’ 함수를 명시적으로 호출합니다.
NavMeshAgent.updatePosition: updatePosition이 false이고 에이전트 트랜스폼이 움직여도 에이전트의 포지션은 바뀌지 않습니다. 이전에는 근처 내비메시 위치에 제한된 트랜스폼 포지션으로 에이전트 포지션이 재설정되었습니다.
NavMeshObstacle 컴포넌트: 새로 생성된 NavMeshObstacle 컴포넌트의 디폴트 형태는 박스입니다. 이제 박스나 캡슐 등 선택된 형태가 카빙과 회피에 적용됩니다.
Unity 이전 버전에서 빌드된 내비메시는 지원되지 않습니다. Unity 5에서 다시 빌드해야 합니다. 모든 씬의 내비메시 데이터를 다시 빌드하는 방법은 다음 스크립트를 참조하십시오.
# 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
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.