How to make an AI check if a point is reachable on NavMesh?

How do I make the AI check if a point or vector is reachable on the NavMesh? I programmed the AI to move in the general direction away from the player but it would stop if it hits a wall, since the next destination is beyond that wall.

In my test setup, I only implemented the NavMesh inside the ThirdPersonTemplate landscape, which is enclosed by walls. The AI would have no problem running away from the player inside the box area, but once it runs into a wall or corner it just stops because it can’t reach the next point which is outside of the box.

So how can I have the AI check if the point it wants to go to is even in the Navmesh ? I read you can use a valid node but isn’t that for objects ? I don’t know how to use a Is Valid node on a location inside the NavMesh, is there maybe a function for that?

Short answer would probably be GetRandomReachablePointInRadius with a very small radius (1m or so).

Long answer: I have no clue if there is some other way to do this ;D

EDIT: There’s also ProjectPointToNavigation (see this post)

1 Like

EQS can be used for this.

how would you use EQS in this case ?

ProjectPointToNavigation seems to work! thanks!

2 Likes

ProjectPointToNavigation is work! Thank you bro!

1 Like