I am developing a game in Unity3D. I want an enemy character to follow the player around. The problem is, my surface is uneven and full of mountains. I am using aarongranberg's pathfinding project. Every time that a player climbs a hill or a mountain, the enemy stops because the grid is flat and it considers the mountain to be an obstacle. How do I solve this problem ?
Essentialy A* needs to be configured with what is not an accessible tile , so you can configure that by making an algorithm using gameObjects 'surface taken on the terrain then calculate the tiles to avoid at runtime .Then add it to the closed list (if there is not something for that already )
Within this project, you are able to define what is passable and impassable terrain. If you recast the graph and alter the maximum slope that's walkable to the gradient of your mountains, they should be included in the navmesh, albeit at a higher cost to use.
There may be other ways, but ultimately, what you want to be looking to do is include the mountain in the mesh as a highly weighted path. I'd recommend reading through the documentation for your A* project