How to make directional idle animations

I wanna make directional idle animations for my top down character, it has for idle animations for all 4 directions and I want it so when my player is stopped facing a certain direction, the correct idle animation is played

Store the last movement direction in a variable.

For instance:

  • Character is moving - set Variable.LastDirection to angle of movement, so that whenever you stop moving, you’ll know what was the last direction in which you were going
  • Then, character is idle & Variable.LastDirection is 0 - set idle animation “right”; angle is 90 - set idle animation “down”; angle is 180 - set idle animation “left”; angle is 270 - set idle animation “up”

I just had to remove the horizontal flip on the action since I had different animations for left and right and now it works