Getting the end node position?

Hello everybody!
I’m currently having troubles with my AI, and I would like to be able to get the vector3 position of the end node of my navmesh path.

My AI is moving using root motion rather than RichAI’s movement, in order for me to keep more control on it. The RichAI is only used to calculate a path, and using my debug Steering target I can send it the informations it needs to play the proper animation…

Basically my problem is that I can’t find a way to tell my AI to stop walking once it has reached the closest point on the current navmesh from the destination target. Once at the (???) position on the picture, it will keep on walking. I could use a second steering target position as well to guide my program, I just need one or the other.

Maybe is there also an other (simpler) solution that I didn’t thought of? Is there a bool that can tell me if there are no more path to walk?

I am currently using RichAI, the “ApproachingPartEndpoint” bool gets true too quick (as soon as the point is in sight) and the “ApproachingPathEndpoint” bool never gets true.

Could someone please help me?

PS : I also have to mention that I use playmaker, and I’m pretty much code illiterate. But I can easily get a code’s variable into my fsm’s, I just need a small code to make the value I need readable.

Sorry to bump my post like that, but I would like to know at least if what I ask is possible or not, just to know if I should stop waiting for an answer and try something else for my project…

Hi

You can use something like this.
It will get the current path from the rp variable, then get the current part of the path that the agent is following (when using links, the path is split into several parts) and get the exact endpoint of that part.

// In the RichAI script
if (rp != null) {
    RichFunnel funnel = rp.GetCurrentPart() as RichFunnel;
    Debug.Log(funnel.exactEnd);
}

Thank you, I guess I missed that in the docs!