From the Animatable example, just need a tad of guidance please on a new project

I want to animate to a direction like I did in the examples but I made a sprite which is spawned in random positions and moves randomly. I can’t seem to remember how to capture the previous position to minus current position. Then I can animate the random direction.