AI PathExist functionality


On screenshot 1 we have 2 objects – place for building and turret, each of them have a colliders with option BlockAllDynamic and each of them have option “Can Affect Navigation” in true. We have a direct path between them (seeing NavMesh). On screenshot 2 we also have a stone, which blocks the path.

And I have some questions:

  1. On sceenshot 1 - how can I check – does path exist between those buildings? Decorator DoesPathExists in behavior tree always returns false in my case.

  2. On screenshot 2 – how can I detect exactly object which blocks the path (the stone in may case)?

Screenshot 1:

Screenshot 2:

Thanks for help in advance!

Stuck in the same situation (problem 1) did you solve it?

Hi, we wrote our function for checking path. Base idea is to build path between two actors and then check is this path intersected with the destination actor.

Well, in fact the exact problem was, I wanted the NPC to stop running towards me if there is no valid path, the AI always ran the NPC to the closest point, I found the solution to my problem in the Node “MoveToLocationOrActor” with the property “AcceptPartialPath” set to false.
But there is something, checking the path validity with IsValid always yielded true, I’m afraid that I’ll stuck in the same situtation again

You can try with the “Is Partial” variable, use the same “Find Path to Actor/Location Synchronously” and get the “Is Partial” variable from the “Result Value” Path it creates. If the actor cannot travel to the target point (due to the path being blocked), the Is Partial variable should be true, if it can reach the target point it should return false.