由于NavMeshAgent组件的加速度Acceleration太高,自动导航到目的地的转角太多,或者角度太小,导致自动导航的时候,
无法到达路径,或者在路径的地方不停徘徊,改变agent.acceleration即可。
...
if(agent.hasPath)
{
Vector3 toTarget = agent.steeringTarget - this.transform.position;
float turnAngle = Vector3.Angle(this.transform.forward,toTarget);
agent.acceleration = turnAngle * agnet.speed;
//Unity NavMesh Area Costs and Agent Speeds Part 2
}
...
相关资料:
1.[Unity][NavMeshAgent]改变速度导致不能自动导航
2.[Unity]NavMeshAgent自动寻路判断到达目的地
3.