"Half-steps" in grid graph

Hi,

I’ve run into another problem with my grid system. It works perfectly except for when I try to drop a unit on an unwalkable node, which results in a weird sort of “half-step” in the path.

My script draws one red square for each node in the path, limited by the range of the unit (8, in this case). The gray area is marked as unwalkable, so the last square should be drawn on the last green tile. This is obviously not the case. Instead, we get a node right next to the unwalkable area, halfway across the grid. Is there a way to prevent the system from doing this?

Hi

You should know that when the graph is shown in the editor, the lines that are drawn are the connections between nodes, so the intersection between two lines is usually a node (though not all if you are using 8 connections).

Also make sure the Seeker -> StartEndModifier -> StartPoint and EndPoint variables are = SnapToNode, that might be what’s causing it.

Thanks a lot, it was the SnapToNode setting. I think I set it to ClosestOnNode while trying to get the system to work and then just sort of forgot about it. This is much better.