I am creating a mobile game but need to know how to make the player with the 'Pathfinding' behaviour actually stick to it's path. Here is a screen-shot of what I don't want to happen:
Look at the text on the image... I want it to follow the straight line from point 7 to point 8 without cutting corners... Help with be appreciated!
Maybe it helps if you set diagonals disabled...
Develop games in your browser. Powerful, performant & highly capable.
As long as you don't pick a new path to find until the current one is finished, this shouldn't be a problem. Sounds like you are resetting the pathfinding as soon as the player presses a new location. Just give each touch an object with an increasing index, and on arrived at X, pick X+1 and path find to that one next. In other words, you have to cache the touches.
you could do it like this