Need Help with pathfinding!

I’m making a 2D strategic top-down game. I need an option to allow units to avoid each other, for example, when a unit is moving and another unit is in front of it – the unit should avoid the unit and continue to the destination. I’m making the game using Grok – it’s handled everything so far, and there’s been a lot of it (almost everything, because you helped me with one thing, and thanks to that, Grok wrote the correct script). I’m new to Godot, and I can’t seem to get it to work with Pathfinder. Either I’m doing something wrong, or Grok is. Is there a tutorial on YouTube, or could someone write a script for me for free and tell me what to do and how? Thanks for answer !

I really don’t recommend using AI to write entire scripts, especially if you aren’t actually going through it line by line to make sure you understand it. There’s nothing wrong with having it explain something, write short snippets (that you understand!), or find a bug in your code, but LLMs like to make mistakes in longer scripts.
And especially with Godot, it’s very easy to get them to hallucinate. I just tried it with Grok and it took two questions for it to accidently invent a new Godot feature

1 Like

For me, Grok does the trick. He’s done this and many other things, writing scripts and telling them what to do, and it all works: https://www.youtube.com/@NEUROSTRUCTURESTUDIO

Can a NavigationPolygon occupy the entire map? That is, a rectangle as the entire playing field.

You should set the area you want the NavigationPolygon to work, that will be the movable area of your map