After generating a path how can I manually modify the waypoint positions?


#1

Hi,

I cannot seem to find any information on this topic on the forum.

I am using a grid graph. After I generate the path I want to modify the position of the nodes. What is the procedure for this operation?

Thank you,


#2

Hi

If you are using your own custom movement script, the easiest is to just modify the vectorPath list on the path object that you get.

void OnPathComplete (Path p) {
    p.vectorPath[0] = new Vector3(1,2,3);
}

Alternatively you could write a modifier. See https://arongranberg.com/astar/docs/writemodifiers.html