So I have a bird sprite that I want to have path find from one end to the other while avoiding clouds. But I also have a ground sprite that I want to move end to end while avoiding rocks . The issue is I don’t want the birds to avoid the rocks , just the clouds and vice versa. It seems there is no way to make pathfinder obstacles only connected to a certain path-finding sprite. Does anyone know a way around this, thank you in advance!
A way to make it is to switch the pathfinding obstacle behavior when the walker looks for a path, as well as when it moves along the path found.
I set up this objects like: Walkers, pathfinding behavior with 32 x 32 cells on the path. Walls, pathfinding obstacles behavior, impassable. Goal is just a mark for the walkers to go.
First I move the walkers to their position. (No really needed, but I was thinking about make the goal object draggable).
When the walker reaches its destination, I deactive the obstacle behavior in the contrary wall, look for a path using the rest of the walls, and then reactivate the obstacle behavior. Do the same for the second walker
When both walkers move, if they get to close to the wall they must ignore, the obstacle behavior is deactivated. When they move away, the behavior is activated again.
Ok. I did a test just for curiosity, and the answer is much more simple…
Just de activate the obstacle behavior for the objects you want your walker to ignore, and activate them again, after a path is found.
The activating and de activating as they walk is not necessary.
I hope this helps