Hi,
I'm using Movement Pack with A* Pathfinding Pro. The graph is generated using Recast Graph. The agent is moving using RichAI component.
I created a simple behavior tree with Follow action. The agent is following the target and when it reaches the target it stops but the problem is that the RichAI.velocity.magnitude is not set to zero. I'm changing the animation of the agent depending on that velocity. When it is zero it plays idle animation from code, larger than zero it plays run animation. The agent now is always having run animation because the velocity is never reaching to zero even when the agent reaches the target and stops moving.
Is there anything I missed? How can I get the current speed of the agent with RichAI? I tested my code with Seek and the same happened. In Seek I can have a workaround because Seek can be terminated once it reaches the target so I can play another action after, but Follow is always running.
I'm using Movement Pack with A* Pathfinding Pro. The graph is generated using Recast Graph. The agent is moving using RichAI component.
I created a simple behavior tree with Follow action. The agent is following the target and when it reaches the target it stops but the problem is that the RichAI.velocity.magnitude is not set to zero. I'm changing the animation of the agent depending on that velocity. When it is zero it plays idle animation from code, larger than zero it plays run animation. The agent now is always having run animation because the velocity is never reaching to zero even when the agent reaches the target and stops moving.
Is there anything I missed? How can I get the current speed of the agent with RichAI? I tested my code with Seek and the same happened. In Seek I can have a workaround because Seek can be terminated once it reaches the target so I can play another action after, but Follow is always running.
Last edited: