How to get a vector3 path from navmesh agent? (247971)

I would like to implement a turn-based movement system (think x-com) and for that, I need a vector3 of all the positions the agent will move to in order to reach its destination. I found there is a path.corners property but it’s not exactly what I want.
How would I do that?

You mentioned NavMeshPath.corners already. This returns an array of corners that, by going in straight lines inbewteen them, make up the agents path (such curves that constist of points connected by straight lines are called polylines btw.).

You can use fairly easy vector algebra, to get what i think you want:

Take 2 points in space a,b represented by their respective location vectors _a,_b. You get the vector _c that points from a to b by _c = _b - _a . Now a straight line between a and b is given by

_f(t) = a + t_c* (Note that _f is a vector as well)

for 0 < t < 1 you reach any point that is on that line. Depending on how you want to deal with movement exactly, you could just divide t in parts by lets say t= 0.2;0.4;0.6;0.8;1 and evaluate f at those and voila you can have any set of vectors on your path you want.