Hi all,
I’ve been working on a system like Super Mario Odyssey’s spin move which detects spinning input (pressing WASD or WDSA in order rapidly) by doing a frame-by-frame analysis of the MoveDirection property. I’ve got a pretty robust implementation going that looks like this:
However, an issue arises when you rotate clockwise:
It’s difficult to see in the gif, but the animation shown does not rotate clockwise akin to the pick-up spinning motion; it rotates counter-clockwise. I currently use dot product to get the angle between the previous and current MoveDirection, but the dot product always returns a positive value for theta.
What I need is a trig. function that will give me the provided output:
I can handle the rest from there. Assume that each of the vectors shown above are unit vectors, too; MoveDirection is a unit vector.
Any help is appreciated!