Need help making a trap

Hello, have been making games with pro version. I’ve searched the forum but couldn’t get the answer.

It’s a 2d topdown game. I’m implementing a trap. It’s supposed to be walkable until ai found the trap. for example, ai has like a 20% chance to find to trap in fov every second and if the ai found it, it moves around the trap. If not, ai should walk over it and take damage.

I have a list of object in sight, so is there any method that change the node unwalkable for specific object? Giving it tags will make every object on the game avoid it.

Thanks for the great asset


You can read more about updating the graph here: Graph Updates during Runtime - A* Pathfinding Project

If you want to control penalty/walkability for individual agents, you can use an ITraversalProvider. See the bottom of this page: Utilities for turn-based games - A* Pathfinding Project