寻路 Navigation

先把障碍物摆放好

 

 

选中障碍物,点static -倒第三个

 

 

 物体添加NavMeshAgent组建

点window-AI-navugation--bake--bake。

移动躲避障碍物

void Update()
{
GetComponent<NavMeshAgent>().SetDestination(GameObject.Find("1").transform.position);
}

 

posted @ 2020-03-20 11:28  哎呦不能错喔  阅读(94)  评论(0编辑  收藏  举报