我有一个与我一起使用SetDestination()的NavMeshAgent,但是即使位置不可达,代理也总是尝试尽可能地靠近目的地。
尝试使用NavMeshPathStatus.PathComplete检查路径是否在目标处结束。
这里是Unity的类似问题解答https://answers.unity.com/questions/1197626/navmesh-how-to-check-if-full-path-available-c.html