Support Forum

GetMovementVector Obsolete

Long time A* user, but damned if I know my old forum username anymore heh.

GetMovementVector has been marked as Obsolete, what was it replaced by?

Hi

I’d recommend using the PathInterpolator class for that. The corresponding code is essentially:

// When your path has been calculated
this.interpolator = new PathInterpolator(path.vectorPath);
// When you want to move
var lookaheadRadius = 1.0;
interpolator.MoveToCircleIntersection2D(transform.position, lookaheadRadius, SimpleMovementPlane.XZPlane);
var movementDirection = interpolator.position - transform.position;

This is also much more robust than the GetMovementVector function.