Support Forum

AI that directly follows grid of nodes rather than taking diagonals

I am trying to set up an AI that takes the shortest path to a target, but also follow a grid-based system. The basic AI provided takes diagonals through nodes.

Example of current situation vs what I’m trying to do: https://imgur.com/a/ZInVVKj

What area of A* should I look into to get the results I’m trying to get? Thanks.

Hi

You can set the "Neighbors* setting on the grid graph to “Four” instead of the default which is “Eight”.

See https://arongranberg.com/astar/docs/gridgraph.html#neighbours

Thanks so much for the help, this fixed my problem.