AIPath.velocity does not reset when stopped

Hi! I’m setting a destination to my agent, it gets there, stops (I can see that it’s not moving anymore), but then, when I try to get AIPath.velocity.magnitude, it is never 0. It gets stuck at some value every time. This really messes up shooting prediction and other things for me.

There was a topic somewhere on the forum of this being the case with RichAI, but I’m not using RichAI – I just have an AIPath.

Any idea why this might be happening?

Edit: I found a solution to my problem. I’m using the Behavior Designer integration with A*, and for some reason, it had agent.canMove = true and agent.canMove = false in its script. I still don’t know why, but commenting those out fixed the problem for me. Here’s a link to the Behavior designer forum: https://www.opsive.com/forum/index.php?threads/bug-velocity-does-not-calculate-properly-with-a-path-seek-task.972/

1 Like