My
NavigationAgent2D is not avoiding other
agents
My
NavigationAgent2Dis not avoiding other agents even thoughavoidance_enabledis set totrueand I've adjusted theradiusandmax_speedvalues accordingly.
In order to use avoidance, it's not enough to enable the setting. You also need to write the code to do the following:
- Connect
NavigationAgent2D'svelocity_computedsignal - Pass the desired velocity during
_physics_process()step toNavigationAgent2D'sset_velocity() - Finally, use the velocity passed by the
velocity_computedsignal to actually do the movement for that physics frame.