Get Vector of the first path and disable turning around

Hello, I want to get the vector of the startNode of the path. For instance: I clicked on my GridGraph area and set the destination in AIPathScript. The Gizmos draw the path and object is start moving. I want to get the first point(Vector) of the following path to estimated the direction. I try

yield return new WaitUntil(() => (GetComponent<Seeker>().GetCurrentPath()).vectorPath.Count > 0); Vector3 nextMovePoint=(GetComponent<Seeker>().GetCurrentPath().vectorPath[0]);

couroutine to obtain it but it tooks so long to trigger this and sometimes just not work at all.

And also have another issue. Can i disable somehow the turning of the object on the start when is not facing the start path?. Sorry for my English, I made an example to make it more clear.

Hi

Perhaps you want to use AIPath.steeringTarget and AIPath.pathPending/AIPath.hasPath instead?

1 Like

Okey i think i figure it out, thanks!. According to my second question. Do you know how to disable turning the object?

Do you not want it to rotate at all?
If so you can disable ‘slow when not facing target’ and then set the rotation speed to 0.

1 Like