Seeking your wisdom ;D
I have a tile based grid, and pathfinder that returns me a path of Nodes in a List. Everything works fine, but!
When I select 2 or more units and tell them to go to some tile, then they will all group together at the end and appear as ONE! They are all occupying the same tile.
This is of course a very old problem and has been solved kazillion times, so I don’t want to invent a new solution kazillion+1 times. Please tip me off how I can solve this, maybe this is a very simple problem.
I was thinking about something like:
- If unit has a path that it is following, verify that there are no obstacles in path. If there are obstacles get new path to goal node.
- If goal node is occupied, find a new goal node that is the nearest unoccupied node to the original goal node.
But doesn’t seem to be working… maybe I did this wrong.