统一定制的纳维梅什障碍地形树?
我有一个带有树木的地形,上面烤到了Navmesh中。 NavMesh会自动在树木周围创建一个障碍,但它似乎是基于模型而不是对撞机的。既然我只希望AI躲避树的树干,而不是树枝,那么如何为树木创建自定义的Navmesh障碍物?我尝试在树上添加Navmesh障碍物,但没有做任何事情。这是一个屏幕截图,显示了我的意思:
基本上,这太大了,我想要一个太大它要较小,并且能够在其上设置自定义的NavMesh障碍物。
I have a terrain with trees on it that is baked into the NavMesh. The NavMesh automatically creates a barrier around the trees, but it seems to be based around the model, not the collider. Since I only want the AI to dodge the trunk of the tree, not the branches, how can I create a custom NavMesh obstacle for the trees? I tried adding a NavMesh obstacle to the tree, but it didn't do anything. Here's a screenshot showing what I mean:
Basically, that's too big of a barrier, I want it to be smaller and be able to set a custom NavMesh obstacle on it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我很确定可以将NavMesh构建源从网格更改为对撞机的选项,但是我找不到它,我想它已从Inspector中删除,但您仍然可以从脚本中生成NavMesh:
I am quite sure there was option to change navmesh build source from mesh to collider but I cannot find it, I suppose it has been removed from inspector but you can still generate your navmesh from script like that:
如果您想遇到较小的障碍,则可以更改代理大小和重新烘烤。
,如果要修改障碍物,则可以使用NavMesh修饰符,并且可以分配为步行区域,因此NavMesh在烘烤时会忽略此障碍。
https://docs.unity3d.com/2020.1/documentation/manalual/manual/manual/manual/manual/manual/manual/ class-navmeshmodifier.html
If you want to smaller barrier you can change your agent size and re-bake.
And if you want modify the obstacles, you can use navmesh modifier and you can assign as walkable area so navmesh will be ignore this obstacle when baking.
https://docs.unity3d.com/2020.1/Documentation/Manual/class-NavMeshModifier.html