Change speed while pursuing

imaethan

New member
I have an enemy AI that gets slower when it's on lower health. The problem is that if it's pursuing it won't slow down until after it completes pursue then starts a new pursue when the player moves away.
1592062026431.png
 
Last edited:
The agent movement speed is only set once when the task starts. In this case when the AI is damaged I would have a separate script that also sets the move speed. If you want this to be completely within the behavior tree you could add a parallel task to the root and then have it continuously update the speed.
 
The agent movement speed is only set once when the task starts. In this case when the AI is damaged I would have a separate script that also sets the move speed. If you want this to be completely within the behavior tree you could add a parallel task to the root and then have it continuously update the speed.
Thanks for the help! :)
 
Top