Is there any way to make a navigation node take straight angles in the pathfinding?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By andresTapa

Hi i am working on ff tactics wanabe game, and i have this grid map, and a navigation mesh that works pretty well, but i need to snapp the units movement to the grid. I managed to snapp them to step in the center of each block of the grid, but when they are supose to go from (1,1) to (2,2) they go directly through the diagonal, and i need them to take an inner step like (2,1) or (1,2).

Is there any way to make that with some parameter in the navigation mesh, like 90º turns, or something?

I think in 2D you can make the navigation polygon a + and it will navigate as you desire. You should be able to do something analogous in 3D. Just be careful when drawing the navigation polygons to make sure all sides of the + match up with the opposite corresponding spots (e.g. east and west).

If that doesn’t work I know you can set up an AStar path finding node to do what you desire.

timothybrentwood | 2021-09-01 00:05

:bust_in_silhouette: Reply From: Andrea

you can make the navigation mesh of the tiles of the grid map cross-shaped: each tile is connected only on the four directions, no diagonal.