Help with using different obstacle layermasks for different seekers

Hello all,

I’m coding AI for a 2D top-down game and using grid graphs for pathfinding. What I’m trying to do is have different enemies which are programmed to avoid different obstacles.

Specifically I want flying enemies to be able to fly over obstacles but still have to go around walls, and in an ideal circumstance I would be able to change this dynamically (enemies that avoid all obstacles but can be told to ignore certain obstacles under specific circumstances)

As far as I can see in the documentation the A* project does not natively support this feature, and I have absolutely no issue altering code to make this work but I’m having a hard time figuring out where to look.

Another alternative is if there’s a way to pass in my own GridNode list to a seeker when it calculates a path, but once again after digging through the code I’m having a hard time finding where the Path type actually uses the GridNode list to calculate. If anyone could point me in the right direction I would greatly appreciate it!

image
hi

you can generate two graphs one for ground one for fly

in the unit seeker

set it only travel the graphs you wish for

Cheer.

2 Likes

In addition to what @eran mentions (see also tutorial here: Multiple agent types - A* Pathfinding Project), you can use an ITraversalProvider (see bottom of Utilities for turn-based games - A* Pathfinding Project), though this is a bit more work.

Thank you so much! I knew I was overlooking something obvious but for whatever reason I missed it when I was skimming through the documentation.

1 Like