[Solved] Large units try to take the same path as small units

I just loaded Example9_Penalties scene that comes with A*.
Everything works nicely.

Then I make 1 of the spider bots 5x bigger
The generated paths still think he can walk between boxes but he does not fit and gets stuck.
What property do i need to update so that the path finding knows where the giant spider bot can or can’t walk based on it’s size?


If you have units which have very different radiuses you can create multiple graphs, one for the smaller ones and one for the larger ones. Then in the call to the StartPath method on the Seeker which is inside the movement script, you can add an extra parameter called graphMask which will tell the Seeker which graphs it is ok to search on.
See http://arongranberg.com/astar/docs/class_seeker.php#ab50a876ab529ceb3eb9b97deb5a48d1e
and http://arongranberg.com/astar/docs/class_pathfinding_1_1_n_n_constraint.php#a63a785ae519f012d295916dd9969170c

1 Like