- Home /
Checking if a non-walkable layer is blocking the path? (NavMeshAgent)
Hi.
I would like to check if a NavMeshAgent's path is being blocked by an object that is not walkable for that particular NavMeshAgent.
There are a few ways this could be possible, but I don't want to do unless I really have to:
Putting a trigger collider to each of the obstacles, tag them, and have an OnTrigger function running on the AI at all times
Shooting a ray from each obstacle and check if it hit the AI
Checking the distance between the obstacle and the AI at all times
If the Unity's navigation system already has a way of checking that, please let me know. Otherwise I'd love to hear your ideas/solutions.
Thanks in advance!
You mean dynamic obstacles, like falling debris and such that are not known at bake/build time?
No, I mean the layered objects, that are baked into the Nav$$anonymous$$esh.