I’m working on a Top-down shooter game, and my character rotates fine, and moves fine, I even have aim offset working well. Where I’m running into trouble is trying to setup the movement animation (walk/run - fwd/bkwd, strafe L/R).
I want the movement animation to be determined by the direction the character is facing with the direction the character is moving and the characters speed. For example, if the character is moving slowly at a 90 degree angle to the direction it is facing, then the character should do the walk-strafe animation.
I’ve tried getting the angle between the character’s velocity (for movement direction) and the the forward vector of the rotation of a socket I added to the characters upper body (for facing direction). The issue with this is that the value I get will always be positive, so that makes it a difficult value to use in the blendspace because blendspace wouldn’t be able to tell the difference for strafing left from right.
But if it was working correctly, wouldn’t I be able to have; lets say the angle from those two vectors is -90, then the character will strafe to the left, and the speed value could determine which speed strafe animation to perform? Perhaps I have to force the angle to be a negative value when I’m holding down a specific movement binding?
I’m not sure if the above is the best way to do this. I’m hoping those will more experience than me can weight in and help me in figuring this out.
Also, I’m fine with working in C++, I’m just doing my prototyping in blueprints.