英文:
In Unity, how to have a navmesh that dynamically update the location of areas
问题
我正在尝试制作一个2D顶视游戏,玩家需要移动障碍物来阻止敌人AI前进,但我需要这些障碍物只阻挡特定类型的敌人。
我尝试过使用Unity的障碍物,但它们会影响到每一个导航网格,所以每个角色都会避开它们(而且我需要将它们设置为"carve",因为如果敌人被困住,我需要他们选择另一条路径)
我考虑过创建一个能改变其下方区域而不是切割网格的障碍物,但我没有找到动态实现这一点的方法,而不需要重新烘焙整个导航网格。
是否有办法实现这一点,或者是否有插件可以提供这些功能?谢谢。
英文:
I am trying to make a 2d top-down game where the player moves obstacles in order to block enemy AI from advancing, but I need the obstacles to only block certain types of enemies.
I've tried using Unity obstacles but they carve through every navmesh so every Agent will avoid them (And I need to set them to carve because I need enemies to take another path if they are stuck)
I've thought about having an obstacle that change the area beneath it instead of carving through the mesh, but I haven't seen any ways to dynamically do that without baking the whole navmesh again.
Is there any way to do that, or a plugin that could give me those features ? Thank you
答案1
得分: 0
你绝对应该查看A*寻路项目。在使用了这个之后,我真的无法再回到使用Unity内置的导航网格系统。
https://arongranberg.com/astar/
他们内置了针对你这种类型情况的解决方案,即有不同的AI层/组。
如果你想尝试的话,有一个免费版本可用
https://arongranberg.com/astar/download
这是免费版和专业版的比较
https://arongranberg.com/astar/freevspro
英文:
You should definitely check out the A* Pathfinding Project. After using this I really can't go back to using Unity's built-in navmesh system.
https://arongranberg.com/astar/
They have built in solutions for exactly your type of situation, ie. there are different layers/groups of AI.
There is a free version available if you would like to try it out
https://arongranberg.com/astar/download
Here's a comparison between Free and Pro
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论