Support Forum

Turn Based Grid Cuts Corners Regardless of Setting

I have the pro version, with version 4.2.15 in my project.

I am working on a 2D turn based grid rpg game. I used this [https://arongranberg.com/astar/documentation/dev_4_1_3_3be515d6/turnbased.php] documentation as a basis for obstacles and pathfinding without colliders. The individual objects use SingleNodeBlockers (larger objects are made up of several node blockers).

Currently, paths generate and will avoid the obstacles correctly. The problem is, I have the Grid Graph set to “8 Directions” with “Cut Corners” disabled, but the paths still cut corners, as shown in the attached images.

I’m not sure if I have something set up wrong causing corners to be cut no matter what, or it’s some sort of bug regarding the way it’s set up for turn based gameplay. Does anyone have any ideas?


Hi

Unfortunately the corner cutting option relies on some pre-processing of the grid connections. It does not support dynamically set walkability like that set by the ITraversalProvider.

Is there a reason your objects cannot be unwalkable in the normal way?

Hi,

Thank you for the information. I will try the normal process of making objects unwalkable. I did it because I was following the guide, but I don’t see a reason why I can’t do it the other way.

Thanks for the quick response time!

It is working great now, thank you for explaining!

1 Like