Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | thenewandy |
Hi, I have a fairly simple project with a character that just finds a path to where the mouse is clicked and follows it. There are two NavigationPolygons to create a scene that is mostly open with a roughly square shaped hole in the middle. When I find paths from A to B they are good, but paths from B to A are very indirect.
Here is a video demonstration with “Visible Navigation” turned on (where “A” is left of the house, and “B” is right of the house):
I’ve tried messing with the polygons to make them overlap or not overlap.
Happy to post code if needed, but it is roughly the code you would expect for a complete beginner to Godot (using a NavigationAgent2D on the character, and the set_target_location() and get_next_location() methods on it to figure out where to move_and_slide() to).
Ok, I can kind of fix it by adding extra vertices to the navigation polygons around the corners of the “hole”. Is this what is expected?
thenewandy | 2023-02-20 23:48