A* Pathfinding Project Problem with Obstacles

I’m using the A* Pathfinding Project (A* Pathfinding Project) for navigation in my “game”. I’m having a few issues and some pointers about where to look would be very useful.

Firstly the object that I want to use to block navigation is only partially recognised, with some of the waypoints going through it. For example:

16883-pathfinding.png

The right hand side of the block in the middle doesn’t remove the grid nodes. The scale I’m using for the world is that the node size is 100, and I’m using a Ray length of 1000 for the height testing, which might be something to do with it, as all the tutorials I’ve seen rely on a smaller world.

Also when I run unity, the seeker seems to stop soon after moving. Although I think that may be related to problems with generating the grid. I’m mostly using code borrowed from this tutorial: Unity 3d: A* Pathfinding for RTS or Tower Defense Style Games - YouTube but with my own custom mesh for the ground and the scales increased.

Any help would be much appreciated.

Try moving the obstacle a littel bit down so that it goes right through the grid instead of just barely touching it, and see if that helps.

Other than that, I suggest to ask directly in Aron’s own forum, he is very helpful and will certainly have the right answer.

BTW, you can modify the grid code easily to include raycasting between nodes just like in point graphs, take a look here:

This way you can have thin walls that block connections instead of having to place the walls on nodes.

I managed to find the solution. I enabled “Thick Raycast” in Height testing and it cleared up the issue. I also found out why the little guy wasn’t making it to the end of the level, which was that he had two colliders that were interfering each other. I didn’t realise that the character controller was also a collider. Doh.