Running Godot 3.0.6 w/ Godotsteam
I've been looking at a problem for a little while and I'm a bit stumped. I've got these buildings with collision polygons and I subtract them from the Navigation2d nav mesh. Those polygons show as red boxes in the gif. I then just do getsimplepath with the mouse click event position and it all works great. Except for these edge cases where the user clicks the on the other side of a building. It goes the long way around. I've got the optimizing enabled, not much else in the way of options.
Going the wrong way around in a nav mesh gif
Code is pretty simple, just takes mouse event as destination.
if event.button_index == BUTTON_LEFT and event.pressed:
mousepos = get_global_mouse_position() - Vector2(0, spriteheight / 4) + mousecursordif
func update_navigation_path(startpos, endpos):
navinst = get_tree().get_nodes_in_group('activenav')
navpath = navinst.get_simple_path(startpos, endpos, true)
Movement is just linear interp between navpath points. Printing out the navpath shows a series of points going the wrong way around. I figure it's something silly i'm doing wrong, but I'm having a hard time figuring it out. Anyone seen this before?