What movment does the character do

Hi, i am trying to do an animation system based on the movement of an object and its facing direction.
But this is where i am stuck, how do i figure out if the object is moving to its side , forward or backward?

I invoke my animation when I execute the movement (from the controller).

You could alternatively compare the transform’s position from the position last frame.