Failed to create agent because there is no valid NavMesh

错误:unity Failed to create agent because there is no valid NavMesh

警告:Failed to create agent because there is no valid NavMesh

问题分析:

        在通过鼠标点击引导人物运动时,报这个错,这是因为没有bake环境(地形)。

        我们通过导航系统来实现避障功能。不经过bake环境,直接调用Nav Mesh Agent组件,就会产生这个错误。

解决办法:

打开Navigation:

Failed to create agent because there is no valid NavMesh

选中我们自己创建的地形:

Failed to create agent because there is no valid NavMesh

在Navigation选中Bake,点击Bake即可。 

 Failed to create agent because there is no valid NavMesh