How to check if a point is reachable on NavMesh

Sorry for asking what must be an obvious newbie question. I searched for a while and couldn’t figure it out.

How do I check if a given target point is reachable on the NavMesh? For example, I want my critter to run from the player so I create a vector from the player to critter, rescale it, and add it to the critter location to get the target. But if the target point is outside the NavMesh (e.g., if the critter is in a corner) then the critter will just stand in the corner. I’d like to say that if the first approach doesn’t yield a valid point then just go to a random location.

Please advise on how to check if a given point is reachable on the NavMesh or a better way to accomplish the above.

Goal is to do this using blueprint.

Thanks,
-X

Hi ,

The best way to do this is to use the “is Valid” node for AI Navigation. If the point is not valid, run the check again to find a proper location for your AI to move to.

Hi ,

Can you post a screenshot of your blueprint? I may get a better idea of how to help if I can see what is going on. Thank you!

Thanks for the quick response. I tried doing that but I don’t know how to feed my navigation mesh into the FindPathToLocationSynchronously in order to get the NavigationPath to feed into IsValid.

My Navigation Mesh is built into the level but when I try to click on the PathFinding context parameter for FindPathToLocationSynchronously it doesn’t show my navmesh.

So how do I get the navmesh to feed into FindPathToLocationSynchronously? Or should I be using some other blueprint tools?

Thanks.

I’ll try to post when I get a chance but I don’t think that will help.

Here is my question again: if I have built a navigation mesh in the level, how do I feed this into FindPathToLocatonSynchronously or how do I feed it into the MoveTo behavior tree node? It seems like the tutorial at (A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine ForumsAI_Behavior_Tree%26_NavMesh:_Part_1) builds a navmesh but I don’t see how he connects this to anything else.

Any suggestions?

Thanks,
-X

just use the “is Valid” node?
i use the"Is Valid aiLocation",is that right?