A* Pathfinding Project

Use RichAI and MecanimBridge to hand animator root motion, But AI pace up and down near destination


#1
anim.SetFloat("MoveBlend", ai.reachedEndOfPath || desiredVelocityWithoutGrav.magnitude < 0.1f ? 0f : 0.35f);

MoveBlend is a variable to blend Idle(0), Walk(0.35f), Run(1.0f);
But if the AI Rich the destination, She is never stop. Always want to close destination and never stop;

var newRot = RotateTowards(desiredVelocityWithoutGrav, Time.deltaTime * (ai as RichAI).rotationSpeed);

I also change code AIPath to RichAI because RichAI Cast to AIPath will throw nullpoint exception.


#2

I solved this by change EndReachedDistance from 0.01f to 0.1f ^.^