How to avoid two NavMeshAgent push away each other in Unity?

对着背影说爱祢 提交于 2019-12-21 15:18:12

问题


In my game, all player and monster characters have a NavMeshAgent component, when one character moves to another, it will push away the second one.

I read the unity docs of NavMeshAgent, found the problem is affected by Obstacle Avoidance Type and Avoidance Priority, I have tried this, but still cannot have a perfect solution, I need the characters DO NOT push each other away and still take others as obstacles.

Please give me some advice how to use NavMeshAgent well and resolve this problem. thanks in advance.


回答1:


Give this article a try, it helped me, should help you too: Pathfinding and Local Avoidance for RPG/RTS Games using Unity




回答2:


I personally have't tried this method, but it can help you. http://forum.unity3d.com/threads/navmesh-and-raycast-obstacle-avoidance.135090/



来源:https://stackoverflow.com/questions/23451983/how-to-avoid-two-navmeshagent-push-away-each-other-in-unity

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!