AILepr. How to stop an agent at a point? Vector3

Hello everyone.
I mathematically found a point in the agent’s path. Now I want the agent to stop for a short while at this point.

 if (ai2.canMove == true)
                    if (tochkiSf.Count != 0)
                        if (transform.position == tochkiSf[0]) 

This code does not work. How to stop the agent at least approximately at the desired point?

Intersections of path and sphere This issue is still relevant.

 if (ai2.canMove == true)
                        if (Vector3.Distance(transform.position, spisokSpecTochki[promShcount]) < 0.1f)
                            ai2.canMove = false;
                            promShcount = promShcount + 1;

Can this be done in some other way?


I would recommend setting ai.destination to the point you calculated. That is the most robust method. Other solutions would require you to either stop inaccurately at the point, or modify the AILerp internals.

I probably can’t use this method. I have all script logic built on “if (ai.reachedDestination)”. It turns out that my path will be interrupted in the wrong place. It’s probably very hard to set up as well as change something in the “AILepr” script.
I’m doing their DnD “Attack Of Opportunity” mechanic. I need the character to stop at points, and then when it is hit, it continues on its way. In the old masterpiece, there was no accuracy in this moment, so the man who makes mods told me. That’s why I don’t need her. Is there any other solution besides my method? Even if it’s not exact.

I don’t know if I should start a new topic. I’ll ask here. I’m trying to calculate the path as quickly as possible.

ai.destination = tochkaYdara; 

is a way of instantly not counting.

Path p = seeker.StartPath(transform.position, tochkaYdara);

this method counts instantly, but then “if (ai.reachedDestination)” or something else does not work, in general, the script does not work well.
Or do these two methods consider the path the same?

If you really want the path to be calculated immediately you could do:

ai.destination = ...;

Yes, that’s what I need. I have fights in turn-based mode. For a single character, there should be no frame delay.

There is no such function. I replaced it with " seeker.GetCurrentPath()". I hope this is the same. I will test.