How to detect what direction is player moving
I'm making a map where player is an armor stand, and the actual player is six blocks up, (i know i could make the armor stand as a custom entity, but i had this idea like 2 years ago and i want to stick with the original idea), and i wanna make that when player moves for example south, but is looking north, armor stand is always looking south, no matter what, when player is moving north, but looking south, armor stand would look north. I'm having a problem with actually making it, detecting what direction the player is moving.