There is an issue with the 2D navigation path

Godot Version

Godot_v4.5-stable_win64

Question

Hello everyone, I am learning navigation for godot. I used navmesh to implement basic pathfinding functions in 2D, but sometimes the path selection can become strange, as shown in the picture!

The path has undergone a strange deviation,What parameter is causing this? :

I cannot click your picture to expand it enough to read what’s in your screenshot. Probably also going to need more info about how you set up the NavigationRegion2D, and how you generated your NavMesh.

1 Like

add the picture

And what does the scene tree look like?

This is the scene tree of the tank and the main This is the scene tree of the tank and the main scene, where the tank will serve as the child node of the unit node in the main scene

tank node from units node:map1/team1/units

Ok, everything appears to be setup correctly. My best suggestion would be to play with the Radius setting in the NavigationPolygon. I notice you changed it to 30px. There are also a ton of settings you could play with in NavigationAgent2D.

The Path Desired Distance, Path Max Distance, and Simplify Path could help. Changing the Avoidance Radius to something smaller could also help.