GraphUpdateScene setTag to non-traversable is causing Seeker to move

Unity Version: 2021.3.1f1
A* Pathfinding Version: 4.2.18 (non-beta)
Graph Type: Grid Graph

Problem: I am trying to use GraphUpdateScene to apply a non-traversable tag to mimic the effects of navmesh cutting. This works fine except that if a Seeker is within the non-traversable region, it will automatically inch out of the non-traversable region. (i.e trying to find the nearest non-traversable area)

For greater clarity - I’ve tested this without any custom movement script or AI destination setter on the Seeker object so I can confirm that it is the Seeker component trying to get out of the non-traversable region.

Solution I am looking for: Seeker stays stationary within the non-traversable region.

What I’ve tried:

  1. Setting AIPath’s “Recalculate path automatically” from ‘Dynamic’ to ‘Never’ → Does nothing
  2. Setting AIPath.canMove = false → It works until I need to Seeker to move again and when I set canMove = true, the Seeker just inches out of the non-traversable region again
  3. Changing Seeker’s tag to a high penalty and traversable = true → It works but non-traversable gives a more accurate pathfinding which is why I am looking for a solution without penalties.
  4. Create a GraphUpdateScene/GraphUpdateObject to reset the tags where the Seeker is standing so there is no overlap → It works but it will also cancel out non-traversable areas which have to be permenant (e.g traps). If I reapply the trap’s non-traversable area, I get the same inching problem again.

Hi

If you make the ground below the seeker non-traversable. The next time it generates a path, it will try to avoid that non-traversable region. If you want it to stay there, you must disable the movement script (AIPath/RichAI/AILerp). Agents will in general never want to be on non-traversable regions of the graph.

For what purpose are you doing this?

Hi

Thanks for the reply. It is as you have said, the problem was that while I did not set any destination or use SetPath, my AIPath was still generating paths since I was using AstarPath.StartPath(path) to display a potential path using a linerenderer. Therefore, while StartPath is not causing my seeker to move to any specific destination, every time a path is generated, the seeker tries to avoid that non-traversable region anyway.

One of my intended purpose was for a spike trap to immobilise a player for X seconds but afterwards the player can naturally click to move away from the activated trap instead of leaving it to the default avoidance behaviour which momentarily robs control away from the player.

I was wondering whether there was a way to disable this default avoidance behaviour when just using StartPath. (Again modifying walkability and penalty may be applicable to some but not in my use case)

Thank you.