Unity3D 导航寻路

先选择Window-->Navigation 在新打开的窗口中点击Bake.this

待烘焙结束以后。spa

给须要导航的物体添加NavMeshAgent组件。能够调整速Speed Radius 等。code

而后blog

1 NavMeshAgent agent = this.GetComponent<NavMeshAgent>();
2 //设置目标
3 agent.SetDestination(player.position);
4 //中止
5 agent.Stop();
相关文章
相关标签/搜索