[BUG] Velocity does not calculate properly with A*Path Seek Task

sdhains

New member
A* pathfinding pro 4.2.5
Behavior Designer movement pack
Behavior Designer 1.6.1

Steps to reproduce:

1. Open example scene for Astar Pathfinding Project
2. Add Test script to the bot with the 'Seek' behavior tree attached:


public class TestVelocity : MonoBehaviour
{
private AIPath _ai;
// Start is called before the first frame update
void Start()
{
_ai = GetComponent<AIPath>();

}

// Update is called once per frame
void Update()
{
Debug.Log(_ai.velocity);

}
}

3. Notice that the velocity does not approach 0 as it reaches destination.
 
You'll want to report this to the A* developer - the Movement Pack just sets a destination and then it's up to A* to do the movement/set the velocity.
 
Hey justin,

Before posting I made sure to check some of the A* examples and there didn't seem to be an issue with calculating velocity.


I managed to fix the problem by commenting out 'agent.canMove = true' and 'agent.canMove =false' in the IAStarAIMovement.cs script - was there a particular reason we were calling this?
 
Thanks for letting me know. I know that in previous versions of A* there would be some slight movement when the A* tasks weren't running so that's why that property was set. I know that version 4.2 of A* was a pretty major update though and I haven't tried it to see if that problem still exists. I'll give it a try.
 
For anyone searching for a solution to this problem: I just wanted to confirm that I had this exact problem in 2021, and also solved it by commenting out agent.canMove = true and agent.canMove = false.
 
Having the same problems here and, yes there were reasons for those two lines to exist...

I´m trying and using the SEEK node and now it does not know to stop at a defined distance, it always move to the destination

(but velocity works now... I mean, it goes to the zero immediatelly)

Not a good solution.
 
Top