Directional Dodging In Top Down Look At Mouse Controls

In my game, when in top down perspective, the mouse determines the character’s rotation, but the movement input is world direction based. So W always goes UP in the world, S goes Down, A goes Left, D goes Right, all independent of your rotation.

(Move Right is the same but with MoveRight, and ABS into World Direction Y)

Problem I’m running into while implementing a dodge mechanic now is that I can’t wrap my head around the math for how to tell it which dodge montage to play based on rotation and input direction.
So if I’m aimed UP in the world, pressing W should play dodge forward.

274551-capture3.png

But if I’m aimed to the LEFT in the world, pressing W should play dodge RIGHT (So It’s still trying to dodge towards UP in the world.)

274552-capture4.png

Basically I need the math to decide which montage to play based on which one would try to dodge in the INPUT direction. Feel like it has something to do with Dot Product or something but like I said, can’t wrap my head around it!

Sorry for Necro but does anyone have a solution for this? Ive looked everywhere and cant seem to find anything to implement for a twin stick shooter style game. Its the exact same issue. I have dorectional roll montages, and they work corrwctly so long as my character is facing “up” in the world, but quickly becomes unpredictable based on the rotation of the character. I was able to get the character to “roll backwards” when the characters back os facing “up” by multiplying the “move up” axis by -1 but i cant get “move right” axis to behave the same. Im ready to scrap the whole function and start fresh with a more elegant solution if one exists that some gracious seasoned developer could bestow it upon me and the community. Thanks in advance for reading this :slight_smile: