How to implement pathfinding entities avoid colliding with other entities?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By AveryRe
:warning: Old Version Published before Godot 3 was released.

Hey there! I’m using navpolys (2D) to make use of Navigation2D. I managed to make the entities avoid walls by restricting the boundaries of the navpoly so theres plenty of room for the characters to move around, but I’m having trouble getting them to avoid other solid objects in my world (ie, crates) with collision shapes.

Has anyone developed a work around or implementation to correct this behaviour? All input would be greatly appreciated!

are these “other solid objects” generated on runtime or are they created with the editor?
afaik they wont work when created on runtime

can you show us your scene hierarchy?
if i remember correctly collision shapes must be childs or grandchilds of the navigation node. if they are deeper they will get ignored.

ingo_nikot | 2017-01-05 13:44

They are nodes instanced then added as children at runtime, but not to the Navigation 2D node. (Ie enemies who spawn into the map)

AveryRe | 2017-01-05 16:45