- Home /
Navmesh overshoots player
Hi all, I have a script called Enemy Follow, and it sets the position of the enemy navmesh agent to my player in Update, but during the game the enemy goes past the player, then has to turn around. How can I fix this?
I'm not sure if I good understood, you want the enemy to follow your player and at certain distance back to the origin position?
Answer by Aeneas_Ferguson · Jan 16, 2021 at 11:12 PM
@mateuszwallace I want the enemy to follow the player, but when the enemy does follow the player, the enemy moves past him for some reason. That is what I want to fix.
Did the enemy navmesh agent destination agrees with previous posiiton of a player?
If you mean that the enemy goes to the previous spot of the player, then yes it does.
I need more detail of your problem.
In on of my level, I have a enemy that is supposed to move toward my player. Both the player and the enemy move at the same speed. But as I walk by the enemy, instead of the enemy trailing the player, he goes past him, then turns around, and then resumes following the player. I guess in short, the enemy doesn't turn fast enough to keep chasing the player.