This commit is contained in:
huyulong 2024-12-13 19:31:29 +08:00
parent 93ec2f5d86
commit b50088ffdf

View File

@ -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;
}
}
}