Thanks for the example, I modified it a little so that the square wouldn't rotate. I'm having a few issues making the motion rotate more than 90 degrees, but I should be able to figure that out. Thanks for your help.
Edit: fixed the issue
Edit2: While it worked in your .cap, I can't replicate it in my .cap. Here's mine: pathfinding.cap.