diff --git a/xiaofang/Assets/Script/npc/RecuseNpc.cs b/xiaofang/Assets/Script/npc/RecuseNpc.cs index 896636f8..2e45ab89 100644 --- a/xiaofang/Assets/Script/npc/RecuseNpc.cs +++ b/xiaofang/Assets/Script/npc/RecuseNpc.cs @@ -98,7 +98,7 @@ public class RecuseNpc : MonoBehaviour float dis = Vector3.Distance(transform.position, currentTarget); // 停止条件改为 NavMeshAgent.stoppingDistance - if (movebool && dis <= navMeshAgent.stoppingDistance) + if (movebool && dis <= 0.2f) { Debug.Log("到达目标点"); nstate = Npcstate.idle; @@ -113,6 +113,10 @@ public class RecuseNpc : MonoBehaviour targetPoints.Clear(); } } + else + { + return; + } } }