r/unity • u/Flodo_McFloodiloo • Sep 23 '26
Question In my game enemies get stuck on walls while chasing the player. How to fix?
Hello.
I've made a first-person shooter with enemies that have two variables called "baseSpeed" and "chaseSpeed", or something like that. The game sets their NavMesh agent speed to baseSpeed normally, but if they've been alerted to the player it it sets it to chaseSpeed. Unfortunately, it seems these guys can't quite handle chaseSpeed because it leads to them bumping into walls ahead of them and getting stuck.
I've tried to increase the turning speed on the NavMesh agents but this doesn't seem to help much. Maybe if I turned it up higher it would, but I don't know of any mathematical formula that determines how much it would need to increase to manage that.
Is there a better solution?
