I am recently getting started with A*, and having trouble with precise pathfinding in my 2d Isometric project. Here’s what the collision bounding boxes in my scene look like (the circle collider is used for the pathfinding character):
And here’s the grid graph I am using:
The problem I’m having is that the character often gets hung up on objects, as if it thinks it should be able to walk right through them. It seems like the pathfinding needs to be aware of the size of the character’s circle collider:
Notice that first portion of the path, where it’s telling the character to walk directly into the couch. The character is unable to do this, so the path is never traversed. I’ve tried adjusting the diameter of the collider sphere in the graph settings, but it doesn’t seem to help at all. Do I need to use a different type of graph?
I wish there was a thorough 2D “Getting Started” document, since I can’t use the CharacterController component. I think my problems may stem from this.
Thanks for the response. I’ve now set the “Connections” to Four and the “Aspect Ratio” to 2, but there doesn’t seem to be any way to get the grid to align to the diagonal isometric perspective. I thought I could just set the graph rotation to X=90 and Y=45, but this does not orient it correctly. No combination of rotations seems to work.
Check the images in the post I linked above, those will show you how I have set it up.
Note that the graph is not orthogonal to the viewing direction, it is tilted.
Unfortunately that is not working for me. It seems those images rely on the camera being rotated 30 degrees, but my project does not use a rotated camera. I put together a basic sample project here, if you have a moment to review my grid graph settings: http://www.codecommode.com/AstarTest.zip
You’ll notice that the AI can not path from one side of the screen to the other, but the manually controlled player can easily fit between the obstacles.