Grid graph: Physics collision offsets 3D model relative to AI path


I just started testing the path finder solution, and it looks like a well created system. I have an issue that based on how easily it happened I though I would find an answer to in the forum, but I did not.

I am using the Ethan model from the standard Unity assets, and I have setup a 50x50 grid graph on a plane, with some boxes (pretty much like the introduction tutorial). I am using the mouse to set the target to the location of where the mouse hit on the plane. Most of the time it works fine, but once in a while, the character will collide with one of the boxes. In these cases, the seeker will continue moving to its target (as if it did not collide), and after the collision, the model follow - however its now offset relative to the target.

An example:

An obvious fix would be to increase the diameter in the Astar path script, and if I set it high enough, these collision stops from happening, but at the same time the character needs to be several tiles away from the boxes.

My question is basically: is this a common problem, and is there a standard solution for it? Or do I just need to make the diameter in the graph higher? Should I use another graph approach?

Thanks for any help!


It looks like you might have a rigidbody and collider attached to the rendered mesh instead of at the root GameObject of the character. The colliders should be attached to the same GameObject as the one with the Seeker and AIPath script.