How to make enemy avoid walls?
I'm making a top down 2D game, and enemy has to chase the player. But even when the player is behind a wall the enemy is trying to walk through it, but the collision stops it from walking through the wall. How can I make the enemy walk around the wall or avoid it in any other way?
Answer by Fjonan · Jan 08, 2018 at 02:51 AM
Check out this unity tutorial on how to define a so called nav mesh and AI that navigates the mesh. This should get you started in the right direction.
I did something similar and basically had the nav mesh agent go to the player position using the destination property and on collision with the player marked him as "caught".
Your answer
Follow this Question
Related Questions
How to fix enemy's rotation (2D) 0 Answers
Enemy AI ignores the distance from the player 0 Answers
How do you use a BFS algorithm in an isometric tilemap? 0 Answers
How to fix enemy's rotation (2D) 0 Answers
Patrol Script not Working 0 Answers