0 votes

I have a game with units moving in formation. This formation is an array of position offsets, so when the player clicks each unit in the formation offset the mouse position to find their destination. This works fine for most cases... but not in tight spaces.
My problem is (A) preventing the units destinations from overlapping each other, while (B) keeping them inside the walkable area -- I'm using navigation2d.getclosestpoint() to keep the destinations inside valid pathfinding areas.

enter image description here

enter image description here

Any ideas?
Thanks!

Godot version 3.3.4
in Engine by (192 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.