TL;DR: Is there a command AI Move As Close As Possible To Position? Which given a vector will move the AI to a reachable point on the NavMesh which minimises the distance between the actor and this input vector
I’m writing a stealth game (in the vain of Thief 1/2). I’m currently working on the AI and trying to implement noise arrows.
The basic concept is the player fires an arrow and on hit the arrow generates a noise and AI will investigate this noise by walking towards it.
Simple idea, straightforward, until you account for the fact that the arrow can hit anywhere in the level including points which aren’t on the nav mesh and thus the AI Move To command will fail as the path is unreachable.
The solution I’ve tried is based on the actual hit location of the arrow (denoted as HL), from HL I perform a line trace downwards until an object hit and store this position as Downwards Trace (DT), and then I use a Project Point To Navigation to get the closest position on the Nav Mesh to the hit location and stored as CP.
The basic idea was to get the AI to move to the closest point (HL, DT, or CP) whether the AI can reach it. However, if neither of these points are reachable the AI gives up.
Sorry for the longwinded explanation, I just thought I should show my progress.
Using the command AI Get Random Reachable Point In Radius is similar to what I want, but I don’t want a random point, I want the closest point in this radius
Hello
I don’t know if it work but
-If you give a range to the noise make by the arrow
-and than tou tell to the ia to search in a random point in the radius near the arrow could this work ?
(sorry for the bad english )
I’ve also tried Project Point To Navigation with a large Query Extent but that doesn’t work, it can be workable. But the problem is, is that if the roof is closer to the noise than the floor, it will project the point to the roof. I could remove the NavMesh from the roofs but I’d rather not do that, because I want some enemies to be on the roof
Just throwing this out there… Could you zero out the Z value of the point where the noise is being made somehow? Or not zero it out, but have it set to the Z value of the AI bot you’re talking to. Then move to this new XYZ location where XY are from the arrow and Z is from the AI?
a bit late. Made a tutor about:
“Move character to the nearest accessable point on navmesh if the endpoint is unreachable.”
it is in russian, but looks it doesnt need translation.